[fpc-devel]Possible bug?

Pavel V. Ozerski pavel at insect.mail.iephb.ru
Thu Mar 28 14:50:07 CET 2002


PVO> The problem seems to be fixed!
PVO> Solution:
PVO> unit pdecsub.pas, procedure handle_calling_convention, inside large
PVO> CASE operator:

PVO> case def.proccalloption of
PVO> ....
PVO>           pocall_pascal :
PVO>             begin
PVO>               include(def.procoptions,po_leftright);
PVO>               st:=tparasymtable.create;
PVO>               parast:=tprocdef(def).parast;
PVO>               lastps:=nil;
PVO>               if parast<>nil then //<<<<<<<<<<<<<<<<<<<
PVO>               while assigned(parast.symindex.first) and (lastps<>tsym(parast.symindex.first)) do

Unfortunatelly, that was only partial solution: at compiling of bigger
programs this bug occured sometimes again. The situation seems to
be more complex. I think, temporary replacing of actprocsym whith
new-created object causes generation of AktProcDef.parast with random
value which can be also not nil but be pointing to random address. I
could to fix this circumstance also:
unit pdecsub.pas, end of procedure parse_var_proc_directives:

        inc(lexlevel);
        AktProcDef.parast:=nil;//<<<<<<<<<<<<<<<<<<<<<<<
        parse_proc_directives(pdflags);
        dec(lexlevel);
        aktprocsym.free;
        aktprocsym:=oldsym;
        aktprocdef:=olddef;
      end;
      
This change seems to be a solution of this problem but I'm not sure
that it is always not wrong and cannot cause lose of data (although
compiler seems to worki correctly now).

-- 
Best regards,
 Pavel                            mailto:pavel at insect.mail.iephb.ru







More information about the fpc-devel mailing list