diff options
author | Tom Willemse | 2022-08-12 19:58:10 -0700 |
---|---|---|
committer | Tom Willemse | 2022-08-12 19:58:10 -0700 |
commit | ad6a98f6ad3cce9d69648360d00d5dcd67d8ca0f (patch) | |
tree | da76141ff43efe1fa5c725bb1624d3b8f6362d06 /clox/src/object.c | |
parent | 38e4c37f0f991122530a708148a6ec0e2a5a3eff (diff) | |
download | crafting-interpreters-ad6a98f6ad3cce9d69648360d00d5dcd67d8ca0f.tar.gz crafting-interpreters-ad6a98f6ad3cce9d69648360d00d5dcd67d8ca0f.zip |
Chapter 26.7
Diffstat (limited to 'clox/src/object.c')
-rw-r--r-- | clox/src/object.c | 4 |
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; } |