mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +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:
parent
9db418e1fb
commit
c392a0cf7f
2 changed files with 16 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue