1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibJS: Use regular stack for VM call frames instead of Vector storage

Keeping the VM call frames in a Vector could cause them to move around
underneath us due to Vector resizing. Avoid this issue by allocating
CallFrame objects on the stack and having the VM simply keep a list
of pointers to each CallFrame, instead of the CallFrames themselves.

Fixes #3830.
Fixes #3951.
This commit is contained in:
Andreas Kling 2020-11-07 11:07:17 +01:00
parent a950d3dd5f
commit 43ff2ea8d8
6 changed files with 36 additions and 27 deletions

View file

@ -35,7 +35,7 @@ Exception::Exception(Value value)
{
auto& call_stack = vm().call_stack();
for (ssize_t i = call_stack.size() - 1; i >= 0; --i) {
String function_name = call_stack[i].function_name;
String function_name = call_stack[i]->function_name;
if (function_name.is_empty())
function_name = "<anonymous>";
m_trace.append(function_name);