|
@@ -36,6 +36,7 @@ interface
|
|
|
private
|
|
|
procedure second_memory_size;
|
|
|
procedure second_memory_grow;
|
|
|
+ procedure second_unreachable;
|
|
|
public
|
|
|
function pass_typecheck_cpu: tnode; override;
|
|
|
function first_cpu: tnode; override;
|
|
@@ -84,6 +85,13 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ procedure twasminlinenode.second_unreachable;
|
|
|
+ begin
|
|
|
+ location_reset(location,LOC_VOID,OS_NO);
|
|
|
+ current_asmdata.CurrAsmList.Concat(taicpu.op_none(a_unreachable));
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
function twasminlinenode.pass_typecheck_cpu: tnode;
|
|
|
begin
|
|
|
Result:=nil;
|
|
@@ -98,6 +106,11 @@ implementation
|
|
|
CheckParameters(1);
|
|
|
resultdef:=u32inttype;
|
|
|
end;
|
|
|
+ in_wasm32_unreachable:
|
|
|
+ begin
|
|
|
+ CheckParameters(0);
|
|
|
+ resultdef:=voidtype;
|
|
|
+ end;
|
|
|
else
|
|
|
Result:=inherited pass_typecheck_cpu;
|
|
|
end;
|
|
@@ -111,6 +124,8 @@ implementation
|
|
|
in_wasm32_memory_size,
|
|
|
in_wasm32_memory_grow:
|
|
|
expectloc:=LOC_REGISTER;
|
|
|
+ in_wasm32_unreachable:
|
|
|
+ expectloc:=LOC_VOID;
|
|
|
else
|
|
|
Result:=inherited first_cpu;
|
|
|
end;
|
|
@@ -124,6 +139,8 @@ implementation
|
|
|
second_memory_size;
|
|
|
in_wasm32_memory_grow:
|
|
|
second_memory_grow;
|
|
|
+ in_wasm32_unreachable:
|
|
|
+ second_unreachable;
|
|
|
else
|
|
|
inherited pass_generate_code_cpu;
|
|
|
end;
|