From 698e5dd9484e0101eb93f688b49d6fdb5c17094b Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 13 Aug 2018 23:01:27 +0200 Subject: [PATCH] Fix access to objects that can be invalid. [GB.JIT] * BUG: Fix access to objects that can be invalid. --- main/lib/jit/gb.jit/jit.h | 2 +- main/lib/jit/jit_body.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/lib/jit/gb.jit/jit.h b/main/lib/jit/gb.jit/jit.h index 470d11066..17afd206b 100644 --- a/main/lib/jit/gb.jit/jit.h +++ b/main/lib/jit/gb.jit/jit.h @@ -295,7 +295,7 @@ enum #define ADDR_CHECK(_check, _val) ({ \ char *_object = (_val).value; \ if (!_object) JIT.throw(E_NULL); \ - if (((void (*)())_check)(_object)) JIT.throw(E_IOBJECT); \ + if (((int (*)())_check)(_object)) JIT.throw(E_IOBJECT); \ _object; \ }) diff --git a/main/lib/jit/jit_body.c b/main/lib/jit/jit_body.c index c387a30c1..6d96dabab 100644 --- a/main/lib/jit/jit_body.c +++ b/main/lib/jit/jit_body.c @@ -904,7 +904,7 @@ static void push_unknown(int index) if (_unsafe) get_addr = STR_print("ADDR_UNSAFE(%s)", expr); else if (class->must_check) - get_addr = STR_print("ADDR_CHECK(%p, %s)", class->must_check, expr); + get_addr = STR_print("ADDR_CHECK(%p, %s)", class->check, expr); else get_addr = STR_print("ADDR(%s)", expr); @@ -1028,7 +1028,7 @@ static void pop_unknown(int index) if (_unsafe) get_addr = STR_print("ADDR_UNSAFE(%s)", expr); else if (class->must_check) - get_addr = STR_print("ADDR_CHECK(%p, %s)", class->must_check, expr); + get_addr = STR_print("ADDR_CHECK(%p, %s)", class->check, expr); else get_addr = STR_print("ADDR(%s)", expr);