Skip to content

Commit 0a1b432

Browse files
committed
Drop call arguments _after_ the call
1 parent 4823f84 commit 0a1b432

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/fizzy/execute.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ inline bool invoke_function(
5858
{
5959
assert(stack.size() >= num_args);
6060
span<const Value> call_args{stack.rend() - num_args, num_args};
61-
stack.drop(num_args);
6261

6362
const auto ret = func(instance, call_args, depth + 1);
64-
// Bubble up traps
6563
if (ret.trapped)
66-
return false;
64+
return false; // Bubble up traps
6765

68-
// Push back the result
66+
stack.drop(num_args);
6967
if (ret.has_value)
70-
stack.push(ret.value);
68+
stack.push(ret.value); // Push back the result
7169

7270
return true;
7371
}

0 commit comments

Comments
 (0)