1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWasm: Implement the br.table instruction

Unlike its name, this instruction has nothing to do with tables, it's
just a very simple switch-case instruction.
This commit is contained in:
Ali Mohammad Pur 2021-06-04 03:27:51 +04:30 committed by Ali Mohammad Pur
parent 9db418e1fb
commit c392a0cf7f
2 changed files with 16 additions and 2 deletions

View file

@ -66,6 +66,9 @@ Result Configuration::execute(Interpreter& interpreter)
if (interpreter.did_trap())
return Trap {};
if (stack().size() <= frame().arity() + 1)
return Trap {};
Vector<Value> results;
results.ensure_capacity(frame().arity());
for (size_t i = 0; i < frame().arity(); ++i)