]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
jit_insn_address_of() returns 0 for constant values
authorAleksey Demakov <ademakov@gmail.com>
Thu, 15 Dec 2005 18:10:09 +0000 (18:10 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Thu, 15 Dec 2005 18:10:09 +0000 (18:10 +0000)
ChangeLog
jit/jit-insn.c

index 8950c4e8165cdeea56a5844f0ac9771dabc799f7..7384174994fb5b2e4efe3cd78a80b8fd816e6c38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-15  Aleksey Demakov  <ademakov@gmail.com>
+
+       * jit/jit-insn.c (jit_insn_address_of): return null if the value is
+       constant.
 
 2005-12-15  Avinash Atreya  <avinashatreya@gmail.com>
 
index e8e18fffc7f073934a51d876281b6ac7122fc930..fa4779c4bc11aa74fdca52cef872055fb0ca3dde 100644 (file)
@@ -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);