From 9ee73a8459eb2bb58adc29da02de312b7e4e7dca Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 5 Aug 2023 04:15:17 +0100 Subject: refactor hashtables, and use objstrings for keys doesn't yet work without string interning, which will require further refactoring --- com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'com.c') 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; -- cgit v1.2.3