Browse Source

[PATCH 150/188] writing jump vector (for br_table) command

From 4f9c81a44945b02ff5f735f8ae21aafee8164d51 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Thu, 26 Mar 2020 10:52:20 -0400

git-svn-id: branches/wasm@46146 -
nickysn 5 years ago
parent
commit
7e64176086
1 changed files with 8 additions and 0 deletions
  1. 8 0
      utils/wasmbin/wasmbinwriter.pas

+ 8 - 0
utils/wasmbin/wasmbinwriter.pas

@@ -669,6 +669,7 @@ end;
 procedure TBinWriter.WriteInstList(list: TWasmInstrList; ofsAddition: LongWord);
 var
   i   : integer;
+  j   : integer;
   ci  : TWasmInstr;
   idx : integer;
   rt  : Byte;
@@ -726,6 +727,13 @@ begin
         WriteU32(dst, ci.operandNum);
       end;
 
+      ipJumpVec: begin
+        writeU32(dst, ci.vecTableCount);
+        for j:=0 to ci.vecTableCount-1 do
+          WriteU32(dst, ci.vecTable[j].idNum);
+        WriteU32(dst, ci.operandNum);
+      end;
+
       ipResType:
         dst.WriteByte(byte(ci.operandNum));
     end;