From 24c283c85ffce54dbd4ccf7ad899f73a7cb17e3c Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sat, 23 Apr 2022 22:46:27 +0200 Subject: [PATCH] compile: Use apfl_string_move_into_new_gc_string --- src/compile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compile.c b/src/compile.c index ccc8eea..896c481 100644 --- a/src/compile.c +++ b/src/compile.c @@ -5,9 +5,9 @@ #include "apfl.h" #include "compile.h" - #include "bytecode.h" #include "resizable.h" +#include "strings.h" #define DEBUG_COMPILING 1 @@ -115,13 +115,12 @@ ilist_put_string(struct instruction_list *ilist, struct apfl_string *string) static bool string_move_into_new(struct compiler *compiler, struct apfl_string **out, struct apfl_string *in) { - struct apfl_string *str = apfl_gc_new_string(compiler->gc); + struct apfl_string *str = apfl_string_move_into_new_gc_string(compiler->gc, in); if (str == NULL) { compiler->error = apfl_error_simple(APFL_ERR_MALLOC_FAILED); return false; } - *str = apfl_string_move(in); *out = str; return true; }