From: Aleksey Demakov Date: Thu, 15 Dec 2005 18:10:09 +0000 (+0000) Subject: jit_insn_address_of() returns 0 for constant values X-Git-Tag: r.0.0.6~17 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=849779221d5f09e1e1cba7188bef0479f57dd532;p=francis%2Flibjit.git jit_insn_address_of() returns 0 for constant values --- diff --git a/ChangeLog b/ChangeLog index 8950c4e..7384174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-12-15 Aleksey Demakov + + * jit/jit-insn.c (jit_insn_address_of): return null if the value is + constant. 2005-12-15 Avinash Atreya diff --git a/jit/jit-insn.c b/jit/jit-insn.c index e8e18ff..fa4779c 100644 --- a/jit/jit-insn.c +++ b/jit/jit-insn.c @@ -3948,27 +3948,19 @@ add_block: jit_value_t jit_insn_address_of(jit_function_t func, jit_value_t value1) { jit_type_t type; - jit_value_t temp; jit_value_t result; if(!value1) { return 0; } - type = jit_type_create_pointer(jit_value_get_type(value1), 1); - if(!type) + if(jit_value_is_constant(value1)) { return 0; } - /* if it is a constant, need to create a temporary and then make that addressable */ - if(jit_value_is_constant(value1)) + type = jit_type_create_pointer(jit_value_get_type(value1), 1); + if(!type) { - temp = jit_value_create(func, jit_value_get_type(value1)); - if(!temp) - { - return 0; - } - jit_insn_store(func, temp, value1); - value1 = temp; + return 0; } jit_value_set_addressable(value1); result = apply_unary(func, JIT_OP_ADDRESS_OF, value1, type);