Correctly compile conversion from object to boolean.

[GB.JIT]
* BUG: Correctly compile conversion from object to boolean.
This commit is contained in:
gambas 2018-08-17 01:04:53 +02:00
parent 979e22f6e9
commit d371614662

View file

@ -393,7 +393,7 @@ static char *get_conv_format(TYPE src, TYPE dest)
case T_BYTE: case T_SHORT: case T_INTEGER: case T_LONG: case T_SINGLE: case T_FLOAT: case T_POINTER:
return "((%s)!=0)";
case T_OBJECT:
return "({ void *_addr = (%s).value; if (_addr) GB.Unref(&_addr); (_addr) != 0; })";
return "({ void *_addr = (%s).value; if (_addr) { GB.Ref(_addr); GB.Unref(&_addr); } (_addr) != 0; })";
}
break;