From ad6a98f6ad3cce9d69648360d00d5dcd67d8ca0f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 12 Aug 2022 19:58:10 -0700 Subject: Chapter 26.7 --- clox/src/object.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clox/src/object.c') diff --git a/clox/src/object.c b/clox/src/object.c index 5f2bdde..376742f 100644 --- a/clox/src/object.c +++ b/clox/src/object.c @@ -58,7 +58,11 @@ static ObjString *allocateString(char *chars, int length, uint32_t hash) { string->length = length; string->chars = chars; string->hash = hash; + + push(OBJ_VAL(string)); tableSet(&vm.strings, string, NIL_VAL); + pop(); + return string; } -- cgit v1.2.3-54-g00ecf