1
0
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:
Bob Nystrom
2014-01-07 23:03:15 -08:00
parent 3be059a137
commit e64d8ace9a

View File

@ -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;
}