[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:
parent
6ca7977d5b
commit
aa1fe3bb1a
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue