mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 19:29:27 +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);
|
internalerror(2010110702);
|
||||||
end;
|
end;
|
||||||
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
|
else
|
||||||
internalerror(2010110703);
|
internalerror(2010110703);
|
||||||
end;
|
end;
|
||||||
|
@ -25,5 +25,14 @@ begin
|
|||||||
testproc4 := q;
|
testproc4 := q;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function testproc5(q: WasmExternRef): WasmExternRef;
|
||||||
|
var
|
||||||
|
w: WasmExternRef;
|
||||||
begin
|
begin
|
||||||
|
w := nil;
|
||||||
|
testproc5 := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
testproc5(nil);
|
||||||
end.
|
end.
|
||||||
|
@ -30,5 +30,14 @@ begin
|
|||||||
testproc4 := q;
|
testproc4 := q;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function testproc5(q: TWasmFuncRef): TWasmFuncRef;
|
||||||
|
var
|
||||||
|
w: TWasmFuncRef;
|
||||||
begin
|
begin
|
||||||
|
w := nil;
|
||||||
|
testproc5 := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
testproc5(nil);
|
||||||
end.
|
end.
|
||||||
|
@ -30,5 +30,14 @@ begin
|
|||||||
testproc4 := q;
|
testproc4 := q;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function testproc5(q: TWasmFuncRef): TWasmFuncRef;
|
||||||
|
var
|
||||||
|
w: TWasmFuncRef;
|
||||||
begin
|
begin
|
||||||
|
w := nil;
|
||||||
|
testproc5 := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
testproc5(nil);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user