Skip to content

Commit 8885f33

Browse files
fix crash bug in handling of LocationRange in array to json
1 parent 585a29f commit 8885f33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/vm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3357,7 +3357,7 @@ class Interpreter {
33573357
const auto thunk = arr->elements[f.elementId];
33583358
const auto loc = f.location;
33593359
const int indentLevel = (f.indentLevel == 0) ? 0 : f.indentLevel + 1;
3360-
const LocationRange tloc = thunk ? thunk->body->location : loc;
3360+
const LocationRange tloc = thunk->body ? thunk->body->location : loc;
33613361
// Add an explicit call frame for the JSON conversion, used to apply depth limit.
33623362
stack.newCall(tloc, arr, nullptr, 0, BindingFrame{});
33633363
stack.newFrame(FRAME_TO_JSON, tloc);

0 commit comments

Comments
 (0)