mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 23:19:29 +02:00
+ introduced is_wasm_externref(tdef) helper
This commit is contained in:
parent
022d2804a9
commit
c33f47a707
@ -208,6 +208,9 @@ const
|
||||
{# Returns true if p is a WebAssembly funcref reference type }
|
||||
function is_wasm_funcref(p : tdef): boolean;
|
||||
|
||||
{# Returns true if p is a WebAssembly externref reference type }
|
||||
function is_wasm_externref(p : tdef): boolean;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -225,6 +228,11 @@ implementation
|
||||
result:=(p.typ=procvardef) and (po_wasm_funcref in tprocvardef(p).procoptions);
|
||||
end;
|
||||
|
||||
function is_wasm_externref(p: tdef): boolean;
|
||||
begin
|
||||
result:=(p.typ=pointerdef) and (tcpupointerdef(p).is_wasm_externref);
|
||||
end;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
tcpuproptertysym
|
||||
@ -298,7 +306,7 @@ implementation
|
||||
prm := tcpuparavarsym(pd.paras[i]);
|
||||
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
|
||||
else if is_wasm_externref(prm.vardef) then
|
||||
result.add_param(wbt_externref)
|
||||
else case prm.paraloc[callerside].Size of
|
||||
OS_8..OS_32, OS_S8..OS_S32:
|
||||
|
@ -107,7 +107,7 @@ unit tgcpu;
|
||||
|
||||
if is_wasm_funcref(def) then
|
||||
wbt := wbt_funcref
|
||||
else if (def.typ=pointerdef) and (tcpupointerdef(def).is_wasm_externref) then
|
||||
else if is_wasm_externref(def) then
|
||||
wbt := wbt_externref
|
||||
else if is_pointer(def) then
|
||||
wbt := wbt_i32 // wasm32
|
||||
|
Loading…
Reference in New Issue
Block a user