From bc3e29e77b8d3d1920d4d5c76009e01169cc460e Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 25 May 2020 11:01:21 +0000 Subject: [PATCH] cgen: fix a bug with tmp strings/free --- vlib/v/gen/str.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/v/gen/str.v b/vlib/v/gen/str.v index 02cd2130f7..c070c6b8e9 100644 --- a/vlib/v/gen/str.v +++ b/vlib/v/gen/str.v @@ -100,7 +100,9 @@ string _STR_TMP(const char *fmt, ...) { //puts('_STR_TMP:'); //puts(g_str_buf); #endif - return tos(g_str_buf, len); + string res = tos(g_str_buf, len); + res.is_lit = true; + return res; } // endof _STR_TMP ")