* new introduded problem with classes fix, the parent class wasn't set

correct, if the class was defined forward before
This commit is contained in:
florian 1998-10-26 22:58:16 +00:00
parent aea3c488fb
commit eadcc6ad1a
7 changed files with 65 additions and 17 deletions

View File

@ -78,7 +78,6 @@ implementation
cleartempgen; cleartempgen;
if assigned(p^.right) then if assigned(p^.right) then
secondpass(p^.right); secondpass(p^.right);
emitl(A_LABEL,lcont); emitl(A_LABEL,lcont);
otlabel:=truelabel; otlabel:=truelabel;
oflabel:=falselabel; oflabel:=falselabel;
@ -738,7 +737,11 @@ do_jmp:
end. end.
{ {
$Log$ $Log$
Revision 1.20 1998-10-06 17:16:42 pierre Revision 1.21 1998-10-26 22:58:16 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.20 1998/10/06 17:16:42 pierre
* some memory leaks fixed (thanks to Peter for heaptrc !) * some memory leaks fixed (thanks to Peter for heaptrc !)
Revision 1.19 1998/09/28 12:13:53 peter Revision 1.19 1998/09/28 12:13:53 peter

View File

@ -104,7 +104,7 @@ var
procedure RecoverStop;{$ifndef FPC}far;{$endif} procedure RecoverStop;{$ifndef FPC}far;{$endif}
begin begin
if assigned(recoverpospointer) then if recoverpospointer<>nil then
LongJmp(recoverpospointer^,1) LongJmp(recoverpospointer^,1)
else else
Halt(1); Halt(1);
@ -242,7 +242,11 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.13 1998-10-26 17:15:17 pierre Revision 1.14 1998-10-26 22:58:17 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.13 1998/10/26 17:15:17 pierre
+ added two level of longjump to + added two level of longjump to
allow clean freeing of used memory on errors allow clean freeing of used memory on errors

View File

@ -25,7 +25,7 @@ unit hcodegen;
interface interface
uses uses
verbose,aasm,tree,symtable verbose,aasm,tree,symtable,cobjects
{$ifdef i386} {$ifdef i386}
,i386 ,i386
{$endif} {$endif}
@ -93,6 +93,15 @@ unit hcodegen;
{ local data is used for smartlink } { local data is used for smartlink }
end; end;
{ some kind of temp. types needs to be destructed }
{ for example ansistring, this is done using this }
{ list }
ttemptodestroy = object(tlinkedlist_item)
typ : tdef;
address : treference;
constructor init(const a : treference;t : tdef);
end;
var var
{ info about the current sub routine } { info about the current sub routine }
procinfo : tprocinfo; procinfo : tprocinfo;
@ -158,10 +167,13 @@ unit hcodegen;
const const
make_const_global : boolean = false; make_const_global : boolean = false;
var
temptoremove : tlinkedlist;
implementation implementation
uses uses
systems,comphook,cobjects,globals,files,strings; systems,comphook,globals,files,strings;
{***************************************************************************** {*****************************************************************************
override the message calls to set codegenerror override the message calls to set codegenerror
@ -379,12 +391,23 @@ implementation
end; end;
end; end;
constructor ttemptodestroy.init(const a : treference;t : tdef);
begin
inherited init;
address:=a;
typ:=t;
end;
end. end.
{ {
$Log$ $Log$
Revision 1.18 1998-10-06 17:16:50 pierre Revision 1.19 1998-10-26 22:58:18 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.18 1998/10/06 17:16:50 pierre
* some memory leaks fixed (thanks to Peter for heaptrc !) * some memory leaks fixed (thanks to Peter for heaptrc !)
Revision 1.17 1998/09/17 09:42:37 peter Revision 1.17 1998/09/17 09:42:37 peter

View File

@ -67,11 +67,12 @@ implementation
secondpassproc = procedure(var p : ptree); secondpassproc = procedure(var p : ptree);
procedure secondnothing(var p : ptree); procedure secondnothing(var p : ptree);
begin begin
end; end;
procedure seconderror(var p : ptree); procedure seconderror(var p : ptree);
begin begin
p^.error:=true; p^.error:=true;
codegenerror:=true; codegenerror:=true;
@ -485,7 +486,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.6 1998-09-23 09:58:52 peter Revision 1.7 1998-10-26 22:58:19 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.6 1998/09/23 09:58:52 peter
* first working array of const things * first working array of const things
Revision 1.5 1998/09/21 10:01:06 peter Revision 1.5 1998/09/21 10:01:06 peter

View File

@ -1121,7 +1121,7 @@ unit pdecl;
class_tobject:=aktclass; class_tobject:=aktclass;
end end
else else
aktclass:=new(pobjectdef,init(n,class_tobject)); aktclass:=new(pobjectdef,init(n,nil));
aktclass^.options:=aktclass^.options or oo_is_class or oo_isforward; aktclass^.options:=aktclass^.options or oo_is_class or oo_isforward;
object_dec:=aktclass; object_dec:=aktclass;
exit; exit;
@ -2082,7 +2082,11 @@ unit pdecl;
end. end.
{ {
$Log$ $Log$
Revision 1.76 1998-10-25 23:31:18 peter Revision 1.77 1998-10-26 22:58:20 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.76 1998/10/25 23:31:18 peter
* procvar parsing updated just like psub.pas routine * procvar parsing updated just like psub.pas routine
Revision 1.75 1998/10/21 08:39:59 florian Revision 1.75 1998/10/21 08:39:59 florian

View File

@ -2573,6 +2573,7 @@
tdef.init; tdef.init;
deftype:=objectdef; deftype:=objectdef;
options:=0; options:=0;
childof:=nil;
publicsyms:=new(psymtable,init(objectsymtable)); publicsyms:=new(psymtable,init(objectsymtable));
publicsyms^.name := stringdup(n); publicsyms^.name := stringdup(n);
{ create space for vmt !! } { create space for vmt !! }
@ -2613,7 +2614,7 @@
publicsyms^.datasize:=publicsyms^.datasize-target_os.size_of_pointer; publicsyms^.datasize:=publicsyms^.datasize-target_os.size_of_pointer;
{ if parent has a vmt field then { if parent has a vmt field then
the offset is the same for the child PM } the offset is the same for the child PM }
if ((c^.options and oo_hasvmt)<>0) then if ((c^.options and oo_hasvmt)<>0) or isclass then
begin begin
vmt_offset:=c^.vmt_offset; vmt_offset:=c^.vmt_offset;
options:=options or oo_hasvmt; options:=options or oo_hasvmt;
@ -3199,7 +3200,11 @@
{ {
$Log$ $Log$
Revision 1.65 1998-10-26 14:19:28 pierre Revision 1.66 1998-10-26 22:58:22 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.65 1998/10/26 14:19:28 pierre
+ added options -lS and -lT for source and target os output + added options -lS and -lT for source and target os output
(to have a easier way to test OS_SOURCE abd OS_TARGET in makefiles) (to have a easier way to test OS_SOURCE abd OS_TARGET in makefiles)
* several problems with rtti data * several problems with rtti data

View File

@ -49,8 +49,8 @@ type
procedure longjmp(const rec : jmp_buf;return_value : longint); procedure longjmp(const rec : jmp_buf;return_value : longint);
{$endif TP} {$endif TP}
var const
recoverpospointer : pjmp_buf; recoverpospointer : pjmp_buf = nil;
implementation implementation
@ -335,7 +335,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.3 1998-10-26 17:15:19 pierre Revision 1.4 1998-10-26 22:58:24 florian
* new introduded problem with classes fix, the parent class wasn't set
correct, if the class was defined forward before
Revision 1.3 1998/10/26 17:15:19 pierre
+ added two level of longjump to + added two level of longjump to
allow clean freeing of used memory on errors allow clean freeing of used memory on errors