فهرست منبع

LibWasm: Make loops work

This commit should hopefully allow for `loop.wast` to be run in CI.
Diego 1 سال پیش
والد
کامیت
b92bd12a8e
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp

+ 2 - 2
Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp

@@ -79,7 +79,7 @@ void BytecodeInterpreter::branch_to_label(Configuration& configuration, LabelInd
         configuration.stack().pop();
         configuration.stack().pop();
     }
     }
 
 
-    for (auto& result : results)
+    for (auto& result : results.in_reverse())
         configuration.stack().push(move(result));
         configuration.stack().push(move(result));
 
 
     configuration.ip() = label->continuation();
     configuration.ip() = label->continuation();
@@ -555,7 +555,7 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi
             break;
             break;
         case BlockType::Index: {
         case BlockType::Index: {
             auto& type = configuration.frame().module().types()[args.block_type.type_index().value()];
             auto& type = configuration.frame().module().types()[args.block_type.type_index().value()];
-            arity = type.results().size();
+            arity = type.parameters().size();
             parameter_count = type.parameters().size();
             parameter_count = type.parameters().size();
         }
         }
         }
         }