forked from Mirror/wren
Ensure upvalue value is initialized.
Avoids a crash if a GC happens before the upvalue is closed.
This commit is contained in:
@ -321,6 +321,7 @@ Upvalue* wrenNewUpvalue(WrenVM* vm, Value* value)
|
||||
initObj(vm, &upvalue->obj, OBJ_UPVALUE);
|
||||
|
||||
upvalue->value = value;
|
||||
upvalue->closed = NULL_VAL;
|
||||
upvalue->next = NULL;
|
||||
return upvalue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user