Skip to content

Commit fe7d148

Browse files
committed
bottom
1 parent 4c1030d commit fe7d148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/fizzy/execute.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, const Value* args,
485485

486486
// FIXME: Remove reference.
487487
auto& sp = stack.sp();
488+
const auto bottom = sp;
488489

489490
while (true)
490491
{
@@ -1523,7 +1524,7 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, const Value* args,
15231524
assert(pc == &code.instructions[code.instructions.size()]); // End of code must be reached.
15241525
assert(stack.size() == instance.module.get_function_type(func_idx).outputs.size());
15251526

1526-
return stack.size() != 0 ? ExecutionResult{*sp} : Void;
1527+
return sp != bottom ? ExecutionResult{*sp} : Void;
15271528

15281529
trap:
15291530
return Trap;

0 commit comments

Comments
 (0)