[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
This commit is contained in:
Benoît Minisini 2010-10-31 16:21:24 +00:00
parent 6ca7977d5b
commit aa1fe3bb1a

View file

@ -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);