From 92e8f08df31395e3e7a1394a3d6ef62cebf8ac77 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 21 Aug 2012 10:08:17 +0200 Subject: [PATCH] don't _move_ values out of immediates, it causes NULL strings to be code-generated --- parser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index b0448bf..9d46159 100644 --- a/parser.c +++ b/parser.c @@ -2450,8 +2450,10 @@ nextvar: else { var->isconst = true; - memcpy(&var->constval, &cval->constval, sizeof(var->constval)); - memset(&cval->constval, 0, sizeof(cval->constval)); + if (cval->expression.vtype == TYPE_STRING) + var->constval.vstring = parser_strdup(cval->constval.vstring); + else + memcpy(&var->constval, &cval->constval, sizeof(var->constval)); ast_unref(cval); } } -- 2.39.2