aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'clox/src/object.c')
-rw-r--r--clox/src/object.c4
1 files changed, 4 insertions, 0 deletions
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;
}