+ support using nil constants for setting values of WebAssembly reference types (funcref and externref)

This commit is contained in:
Nikolay Nikolov 2023-06-11 06:23:02 +03:00
parent ca03841724
commit 9daabb2123
4 changed files with 39 additions and 0 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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.