From aa1fe3bb1a57a7aa226a0b28bc2680a695f6d644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 31 Oct 2010 16:21:24 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Variants can be constant strings (in database drivers for example). So keep the constant string datatype when undoing the variant. Otherwise, the constant string will be assumed to be a Gambas string, and will be deallocated, which leads to a crash. git-svn-id: svn://localhost/gambas/trunk@3270 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_value.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/gbx/gbx_value.c b/main/gbx/gbx_value.c index b6fea06a5..b59e7a267 100644 --- a/main/gbx/gbx_value.c +++ b/main/gbx/gbx_value.c @@ -629,8 +629,8 @@ __s2v: STRING_unref(&value->_string.addr); } + value->_variant.vtype = T_STRING; //value->type; value->_variant.value._string = addr; - value->_variant.vtype = T_STRING; value->type = T_VARIANT; return; @@ -1859,7 +1859,7 @@ __CSTRING: { char *str = value->_variant.value._string; - value->type = T_STRING; + value->type = T_CSTRING; value->_string.addr = str; value->_string.start = 0; value->_string.len = strlen(str);