浏览代码

LibWasm: Make structured_end() jump to the instruction after itself

Ali Mohammad Pur 4 年之前
父节点
当前提交
025b3349e4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWasm/Parser/Parser.cpp

+ 1 - 1
Userland/Libraries/LibWasm/Parser/Parser.cpp

@@ -303,7 +303,7 @@ ParseResult<Vector<Instruction>> Instruction::parse(InputStream& stream, Instruc
                 result.value().values.append(Instruction { Instructions::structured_end });
 
                 // Transform op(..., instr*) -> op(...) instr* op(end(ip))
-                result.value().values.prepend(Instruction { opcode, StructuredInstructionArgs { BlockType { block_type.release_value() }, ip, {} } });
+                result.value().values.prepend(Instruction { opcode, StructuredInstructionArgs { BlockType { block_type.release_value() }, ++ip, {} } });
                 return result.release_value().values;
             }