* correctly handle calling convention for function references

This commit is contained in:
Sven/Sarah Barth 2022-02-05 21:36:50 +01:00
parent 47d7520b32
commit 533a11ec80
3 changed files with 24 additions and 4 deletions

View File

@ -222,6 +222,7 @@ implementation
orgname : TIDString;
hdef : tdef;
sym : tsym;
flags : thccflags;
dummysymoptions : tsymoptions;
deprecatedmsg : pshortstring;
storetokenpos,filepos : tfileposinfo;
@ -341,7 +342,11 @@ implementation
skip_initialiser:=true;
end;
{ add default calling convention }
handle_calling_convention(hdef,hcc_default_actions_intf);
if hdef.typ=procvardef then
flags:=hcc_default_actions_intf
else
flags:=hcc_default_actions_intf_struct;
handle_calling_convention(hdef,flags);
end;
{ Parse the initialiser }
if not skip_initialiser then
@ -698,6 +703,7 @@ implementation
defpos,storetokenpos : tfileposinfo;
old_block_type : tblock_type;
old_checkforwarddefs: TFPObjectList;
flags : thccflags;
setdummysym,
first,
isgeneric,
@ -1074,7 +1080,11 @@ implementation
if current_scanner.replay_stack_depth=0 then
hdef.register_def;
end;
handle_calling_convention(hdef,hcc_default_actions_intf);
if hdef.typ=procvardef then
flags:=hcc_default_actions_intf
else
flags:=hcc_default_actions_intf_struct;
handle_calling_convention(hdef,flags);
if (hdef.typ=procvardef) and (po_is_function_ref in tprocvardef(hdef).procoptions) then
begin
if (po_is_block in tprocvardef(hdef).procoptions) and

View File

@ -1345,6 +1345,7 @@ implementation
vs : tabstractvarsym;
hdef : tdef;
i : longint;
flags : thccflags;
first,
isgeneric,
semicoloneaten,
@ -1557,7 +1558,11 @@ implementation
end;
end;
{ Add calling convention for procvar }
handle_calling_convention(hdef,hcc_default_actions_intf);
if hdef.typ=procvardef then
flags:=hcc_default_actions_intf
else
flags:=hcc_default_actions_intf_struct;
handle_calling_convention(hdef,flags);
{ Handling of Delphi typed const = initialized vars }
if (token=_EQ) and
not(m_tp7 in current_settings.modeswitches) and

View File

@ -1659,6 +1659,7 @@ uses
tsrsym : ttypesym;
psym,
srsym : tsym;
flags : thccflags;
paramdef1,
paramdef2,
def : tdef;
@ -2020,7 +2021,11 @@ uses
parse_proctype_directives(tprocvardef(result));
if po_is_function_ref in tprocvardef(result).procoptions then
adjust_funcref(result,srsym,nil);
handle_calling_convention(result,hcc_default_actions_intf);
if result.typ=procvardef then
flags:=hcc_default_actions_intf
else
flags:=hcc_default_actions_intf_struct;
handle_calling_convention(result,flags);
if not hintsprocessed and (replaydepth>current_scanner.replay_stack_depth) then
begin
try_consume_hintdirective(ttypesym(srsym).symoptions,ttypesym(srsym).deprecatedmsg);