From 03fc5d23235c1b6b7184b9278aae7ebc4546c2c1 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Wed, 17 Jan 2024 08:32:10 +0200 Subject: [PATCH] + added a zero/unitialized/unknown value to TWasmBasicType: wbt_Unknown --- compiler/wasm32/agwat.pas | 2 +- compiler/wasm32/cpubase.pas | 3 ++- compiler/wasm32/itcpugas.pas | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/wasm32/agwat.pas b/compiler/wasm32/agwat.pas index 1dd6852158..9a42aefa56 100644 --- a/compiler/wasm32/agwat.pas +++ b/compiler/wasm32/agwat.pas @@ -402,7 +402,7 @@ implementation InlineLevel : longint; do_line : boolean; const - WasmBasicTypeStr : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128'); + WasmBasicTypeStr : array [TWasmBasicType] of string = ('unknown','i32','i64','f32','f64','funcref','externref','v128'); begin if not assigned(p) then diff --git a/compiler/wasm32/cpubase.pas b/compiler/wasm32/cpubase.pas index e432f38264..c399714840 100644 --- a/compiler/wasm32/cpubase.pas +++ b/compiler/wasm32/cpubase.pas @@ -131,6 +131,7 @@ uses ); TWasmBasicType = ( + wbt_Unknown, { number types } wbt_i32, wbt_i64, wbt_f32, wbt_f64, { reference types } @@ -680,7 +681,7 @@ uses function TWasmFuncType.ToString: ansistring; const - wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128'); + wasm_basic_type_str : array [TWasmBasicType] of string = ('unknown','i32','i64','f32','f64','funcref','externref','v128'); var i: Integer; begin diff --git a/compiler/wasm32/itcpugas.pas b/compiler/wasm32/itcpugas.pas index 59cf3c34c4..fe52c4a75b 100644 --- a/compiler/wasm32/itcpugas.pas +++ b/compiler/wasm32/itcpugas.pas @@ -129,7 +129,7 @@ interface 'memory.atomic.wait32', 'memory.atomic.wait64', 'memory.atomic.notify', 'atomic.fence' ); - gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128'); + gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('unknown','i32','i64','f32','f64','funcref','externref','v128'); function gas_regname(r:Tregister):string;