Browse Source

* Small refactor for easier debugging

Michaël Van Canneyt 2 months ago
parent
commit
ee3fb55442
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/wasm32/cpubase.pas

+ 5 - 2
compiler/wasm32/cpubase.pas

@@ -671,9 +671,12 @@ uses
       end;
       end;
 
 
     procedure TWasmFuncType.add_param(param: TWasmBasicType);
     procedure TWasmFuncType.add_param(param: TWasmBasicType);
+    var
+      len : integer;
       begin
       begin
-        SetLength(params,Length(params)+1);
-        params[High(params)]:=param;
+        len:=Length(params);
+        SetLength(params,len+1);
+        params[len]:=param;
       end;
       end;
 
 
     procedure TWasmFuncType.add_result(res: TWasmBasicType);
     procedure TWasmFuncType.add_result(res: TWasmBasicType);