mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Don't copy current program counter into new execution contexts
This didn't make any sense, and was already handled by pushing a new execution context anyway. By simply removing these bogus lines of code, we fix a bug where throwing inside a function whose bytecode was shorter than the calling function would crash trying to generate an Error stack trace (because the bytecode offset we were trying to symbolicate was actually from the longer caller function, and not valid in the callee function.) This makes --log-all-js-exceptions less crash prone and more helpful.
This commit is contained in:
committed by
Andreas Kling
parent
0c77b3bf59
commit
b3f77e4769
@@ -147,7 +147,6 @@ ThrowCompletionOr<Value> NativeFunction::internal_call(Value this_argument, Read
|
||||
// 8. Perform any necessary implementation-defined initialization of calleeContext.
|
||||
callee_context->this_value = this_argument;
|
||||
callee_context->arguments.append(arguments_list.data(), arguments_list.size());
|
||||
callee_context->program_counter = vm.bytecode_interpreter().program_counter();
|
||||
|
||||
callee_context->lexical_environment = caller_context.lexical_environment;
|
||||
callee_context->variable_environment = caller_context.variable_environment;
|
||||
@@ -210,7 +209,6 @@ ThrowCompletionOr<NonnullGCPtr<Object>> NativeFunction::internal_construct(Reado
|
||||
|
||||
// 8. Perform any necessary implementation-defined initialization of calleeContext.
|
||||
callee_context->arguments.append(arguments_list.data(), arguments_list.size());
|
||||
callee_context->program_counter = vm.bytecode_interpreter().program_counter();
|
||||
|
||||
callee_context->lexical_environment = caller_context.lexical_environment;
|
||||
callee_context->variable_environment = caller_context.variable_environment;
|
||||
|
||||
Reference in New Issue
Block a user