Browse Source

+ added a zero/unitialized/unknown value to TWasmBasicType: wbt_Unknown

Nikolay Nikolov 1 year ago
parent
commit
03fc5d2323
3 changed files with 4 additions and 3 deletions
  1. 1 1
      compiler/wasm32/agwat.pas
  2. 2 1
      compiler/wasm32/cpubase.pas
  3. 1 1
      compiler/wasm32/itcpugas.pas

+ 1 - 1
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

+ 2 - 1
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

+ 1 - 1
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;