mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 23:19:29 +02:00
+ introduced is_wasm_funcref(tdef) helper
This commit is contained in:
parent
dd09bf64b3
commit
022d2804a9
@ -205,6 +205,8 @@ type
|
||||
const
|
||||
pbestrealtype : ^tdef = @s64floattype;
|
||||
|
||||
{# Returns true if p is a WebAssembly funcref reference type }
|
||||
function is_wasm_funcref(p : tdef): boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -218,6 +220,11 @@ implementation
|
||||
tgcpu
|
||||
;
|
||||
|
||||
function is_wasm_funcref(p: tdef): boolean;
|
||||
begin
|
||||
result:=(p.typ=procvardef) and (po_wasm_funcref in tprocvardef(p).procoptions);
|
||||
end;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
tcpuproptertysym
|
||||
@ -289,7 +296,7 @@ implementation
|
||||
for i:=0 to pd.paras.Count-1 do
|
||||
begin
|
||||
prm := tcpuparavarsym(pd.paras[i]);
|
||||
if (prm.vardef.typ=procvardef) and (po_wasm_funcref in tprocvardef(prm.vardef).procoptions) then
|
||||
if is_wasm_funcref(prm.vardef) then
|
||||
result.add_param(wbt_funcref)
|
||||
else if (prm.vardef.typ=pointerdef) and (tcpupointerdef(prm.vardef).is_wasm_externref) then
|
||||
result.add_param(wbt_externref)
|
||||
|
@ -105,7 +105,7 @@ unit tgcpu;
|
||||
if not Result then
|
||||
Exit;
|
||||
|
||||
if (def.typ=procvardef) and (po_wasm_funcref in tprocvardef(def).procoptions) then
|
||||
if is_wasm_funcref(def) then
|
||||
wbt := wbt_funcref
|
||||
else if (def.typ=pointerdef) and (tcpupointerdef(def).is_wasm_externref) then
|
||||
wbt := wbt_externref
|
||||
|
Loading…
Reference in New Issue
Block a user