[GD-Windows] Re : Strange prolog function issue
Brought to you by:
vexxed72
From: Emmanuel A. <e_a...@ya...> - 2006-07-25 23:12:48
|
Hi,=20 =20 It only happens in release build. And as you said, I suspect a compiler bug= . =20 Actually, I don't understand when the compiler decide to switch to a differ= ent prolog for the function, where ebp doesn't have the same meaning. It is all fine as the function code knows the different ebp meaning, and ha= s no trouble accessing local vars, but the exception handler seems not to b= e aware of the change in the ebp meaning. =20 Thanks for your help,=20 we send a mail to microsoft, we will wait for their anwser... =20 Emmanuel Ps : Kent, replying to your mails only replies to you, not to the list...= =20 ----- Message d'origine ---- De : Kent Quirk <ken...@co...> =C3=80 : Emmanuel Astier <e_a...@ya...>; Game Development for MS Windo= ws <gam...@li...> Envoy=C3=A9 le : Mardi, 25 Juillet 2006, 6h09mn 40s Objet : Re: [GD-Windows] Strange prolog function issue Emmanuel Astier wrote: > Hi all,=20 > =20 > =20 > I have here a very strange issue. > =20 > We have a function using a local std::string, exceptions, and a alloca. > =20 > When the exception is thrown, the unwind mecanism tries to delete the std= ::string, but it deletes it at a wrong address( there is a 0x590 offset ). > =20 > <snip>=20 > =20 > I could not reproduce this ebp offset that makes the exception handler fa= il in a small sample.=20 > So do you know in which case the compiler does not put esp in ebp, but pu= t an offset in it ? > And do you know how to fix it ( other than what we're doing : stopping us= ing alloca with exceptions ), if it is a kind a known issue ?=20 > =20 Does the bug occur in both debug and release builds? Have you tried=20 setting the optimization manually for that file? In any large project,=20 I usually find a couple of files that drive some form of compiler bug=20 under full optimization, and I have to manually turn down the=20 optimization on that particular file or do some sort of special (heavily=20 commented!) adaptation, such as moving a function's location in the=20 source file, or in the header file. You might also try playing with a=20 couple of exception-related compiler switches. Compilers are complicated=20 beasts, and any project of a significant size is likely to drive a bug=20 or two. |