summaryrefslogtreecommitdiff
path: root/com.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-08-05 04:15:17 +0100
committerubq323 <ubq323@ubq323.website>2023-08-05 04:15:20 +0100
commit9ee73a8459eb2bb58adc29da02de312b7e4e7dca (patch)
treef41bddde050c61e254af8ba4c53a3bc11ca7b804 /com.c
parent93fe66fb8ef5c731b46a30a804f74b4bf3b133d7 (diff)
refactor hashtables, and use objstrings for keys
doesn't yet work without string interning, which will require further refactoring
Diffstat (limited to 'com.c')
-rw-r--r--com.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com.c b/com.c
index 387d709..e371e6d 100644
--- a/com.c
+++ b/com.c
@@ -18,7 +18,7 @@ static void compile_node(Chunk *ch, AstNode a) {
break;
case AST_STRING: {
size_t len = strlen(a.as.str);
- ObjString *o = objstring_new(a.as.str, len);
+ ObjString *o = objstring_copy(a.as.str, len);
chunk_wbc(ch, OP_LOADK);
chunk_wbc(ch, chunk_wconst(ch, VAL_OBJ(o)));
break;