mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:49:26 +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;
|
||||
begin
|
||||
secondpass(tcallparanode(left).left);
|
||||
{ force left to be an OS_ADDR, since in case of method procvars }
|
||||
{ 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_cmp_const_loc_label(current_asmdata.CurrAsmList,def_cgsize(left.resultdef),OC_NE,0,tcallparanode(left).left.location,current_procinfo.CurrTrueLabel);
|
||||
cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
||||
location_reset(location,LOC_JUMP,OS_NO);
|
||||
end;
|
||||
|
@ -2258,9 +2258,18 @@ implementation
|
||||
begin
|
||||
{ the parser has already made sure the expression is valid }
|
||||
|
||||
{ there could be a procvar, which is 2*sizeof(pointer), while we }
|
||||
{ must only check the first pointer -> can't just convert to an }
|
||||
{ add node in all cases }
|
||||
{ in case of a complex procvar, only check the "code" pointer }
|
||||
if (tcallparanode(left).left.resultdef.typ=procvardef) and
|
||||
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]);
|
||||
resultdef:=booltype;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user