Browse Source

[PATCH 143/188] splitting normalization between function reference
number

From 523144777fd5df98f3b40962d7c1a7729adc39a5 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Wed, 25 Mar 2020 11:59:02 -0400

git-svn-id: branches/wasm@46139 -

nickysn 5 years ago
parent
commit
49e71fe739
1 changed files with 7 additions and 2 deletions
  1. 7 2
      utils/wasmbin/wasmmodule.pas

+ 7 - 2
utils/wasmbin/wasmmodule.pas

@@ -1050,11 +1050,16 @@ begin
     f.idNum := fnIdx;
 
     NormalizeFuncType(m, f.functype);
+
+    inc(fnIdx);
+  end;
+
+  // normalizing function body
+  for i:=0 to m.FuncCount-1 do begin
+    f:=m.GetFunc(i);
     // finding the reference in functions
     // populating "nums" where string "index" is used
     NormalizeInst(m, f, f.instr);
-
-    inc(fnIdx);
   end;
 
   // normalizing exports