mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 07:39:25 +02:00
+ support using nil constants for setting values of WebAssembly reference types (funcref and externref)
This commit is contained in:
parent
ca03841724
commit
9daabb2123
@ -449,6 +449,18 @@ implementation
|
||||
internalerror(2010110702);
|
||||
end;
|
||||
end;
|
||||
R_EXTERNREFREGISTER:
|
||||
begin
|
||||
if a<>0 then
|
||||
internalerror(2023061101);
|
||||
list.Concat(taicpu.op_none(a_ref_null_externref));
|
||||
end;
|
||||
R_FUNCREFREGISTER:
|
||||
begin
|
||||
if a<>0 then
|
||||
internalerror(2023061102);
|
||||
list.Concat(taicpu.op_none(a_ref_null_funcref));
|
||||
end;
|
||||
else
|
||||
internalerror(2010110703);
|
||||
end;
|
||||
|
@ -25,5 +25,14 @@ begin
|
||||
testproc4 := q;
|
||||
end;
|
||||
|
||||
function testproc5(q: WasmExternRef): WasmExternRef;
|
||||
var
|
||||
w: WasmExternRef;
|
||||
begin
|
||||
w := nil;
|
||||
testproc5 := nil;
|
||||
end;
|
||||
|
||||
begin
|
||||
testproc5(nil);
|
||||
end.
|
||||
|
@ -30,5 +30,14 @@ begin
|
||||
testproc4 := q;
|
||||
end;
|
||||
|
||||
function testproc5(q: TWasmFuncRef): TWasmFuncRef;
|
||||
var
|
||||
w: TWasmFuncRef;
|
||||
begin
|
||||
w := nil;
|
||||
testproc5 := nil;
|
||||
end;
|
||||
|
||||
begin
|
||||
testproc5(nil);
|
||||
end.
|
||||
|
@ -30,5 +30,14 @@ begin
|
||||
testproc4 := q;
|
||||
end;
|
||||
|
||||
function testproc5(q: TWasmFuncRef): TWasmFuncRef;
|
||||
var
|
||||
w: TWasmFuncRef;
|
||||
begin
|
||||
w := nil;
|
||||
testproc5 := nil;
|
||||
end;
|
||||
|
||||
begin
|
||||
testproc5(nil);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user