From d371614662487b0f60f9e1bb0365dfefb8417f1a Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 17 Aug 2018 01:04:53 +0200 Subject: [PATCH] Correctly compile conversion from object to boolean. [GB.JIT] * BUG: Correctly compile conversion from object to boolean. --- main/lib/jit/jit_body.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/lib/jit/jit_body.c b/main/lib/jit/jit_body.c index bfde0a362..0c56a9b08 100644 --- a/main/lib/jit/jit_body.c +++ b/main/lib/jit/jit_body.c @@ -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;