mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 13:09:22 +02:00
* corrected version of r16812: code generation is still handled specially
for assigned(), but the type information is now correct so it doesn't have to be forced to OS_ADDR anymore git-svn-id: trunk@16819 -
This commit is contained in:
parent
0f35da07f1
commit
04e26bfc85
@ -640,9 +640,7 @@ implementation
|
|||||||
procedure tcginlinenode.second_assigned;
|
procedure tcginlinenode.second_assigned;
|
||||||
begin
|
begin
|
||||||
secondpass(tcallparanode(left).left);
|
secondpass(tcallparanode(left).left);
|
||||||
{ force left to be an OS_ADDR, since in case of method procvars }
|
cg.a_cmp_const_loc_label(current_asmdata.CurrAsmList,def_cgsize(left.resultdef),OC_NE,0,tcallparanode(left).left.location,current_procinfo.CurrTrueLabel);
|
||||||
{ the size is 2*OS_ADDR (JM) }
|
|
||||||
cg.a_cmp_const_loc_label(current_asmdata.CurrAsmList,OS_ADDR,OC_NE,0,tcallparanode(left).left.location,current_procinfo.CurrTrueLabel);
|
|
||||||
cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
||||||
location_reset(location,LOC_JUMP,OS_NO);
|
location_reset(location,LOC_JUMP,OS_NO);
|
||||||
end;
|
end;
|
||||||
|
@ -2258,9 +2258,18 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ the parser has already made sure the expression is valid }
|
{ the parser has already made sure the expression is valid }
|
||||||
|
|
||||||
{ there could be a procvar, which is 2*sizeof(pointer), while we }
|
{ in case of a complex procvar, only check the "code" pointer }
|
||||||
{ must only check the first pointer -> can't just convert to an }
|
if (tcallparanode(left).left.resultdef.typ=procvardef) and
|
||||||
{ add node in all cases }
|
not tprocvardef(tcallparanode(left).left.resultdef).is_addressonly then
|
||||||
|
begin
|
||||||
|
inserttypeconv_explicit(tcallparanode(left).left,search_system_type('TMETHOD').typedef);
|
||||||
|
tcallparanode(left).left:=csubscriptnode.create(tsym(tabstractrecorddef(tcallparanode(left).left.resultdef).symtable.find('CODE')),tcallparanode(left).left);
|
||||||
|
tcallparanode(left).get_paratype;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ converting to an add node is tricky because of differences
|
||||||
|
in procvar handling between FPC and Delphi handling, so
|
||||||
|
handle specially }
|
||||||
set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
|
set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
|
||||||
resultdef:=booltype;
|
resultdef:=booltype;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user