[fpc-devel] Misterious error

Sergei Gorelkin sergei_gorelkin at mail.ru
Sat Dec 31 17:07:42 CET 2011


31.12.2011 18:52, José Mejuto пишет:
> Hello FPC,
>
> Saturday, December 31, 2011, 3:39:59 PM, you wrote:
>
> SG>  r19668 affects codegeneration of constructors and custom enumerators, and fixes
> SG>  http://bugs.freepascal.org/view.php?id=20827
> SG>  The reported location of crash in your case is likely
> SG>  unrelated to the actual location of problem.
> SG>  At least, function WindowProc from win32callback.inc is not
> SG>  affected by r19668, as it isn't a
> SG>  constructor and doesn't involve exception handling in unmodified form.
> SG>  If your code contains constructors which use interfaces, I'd
> SG>  suggest them as the place to look at or
> SG>  try to modify.
>
> Reverting this change in r19668, line 700:
>
>            begin
>              { Constructors need the destroy-on-exception code even if they don't
>                use managed variables/temps. }
>              //if (cs_implicit_exceptions in current_settings.moduleswitches) and
>              //   (is_class(procdef.struct) and (procdef.proctypeoption=potype_constructor)) then
>              //  maybe_add_constructor_wrapper(code,true)
>              //else
>                maybe_add_constructor_wrapper(code,false);
>              addstatement(newstatement,loadpara_asmnode);
>
> Makes everything work fine again. The if..else was added by you in
> 19668. Maybe a forgotten situation to generate stackframe ?
>
Plain removal of this if..else breaks a couple of tests in the testsuite. But the information you 
provided gives some pointers to look at. At least, adding a check that constructor without 
pi_needs_implicit_finally flag doesn't have any implicit finalization code either will help 
detecting the actual place of trouble.
I'll review it.

Regards,
Sergei



More information about the fpc-devel mailing list