libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libjit] [PATCH] fix jit_insn_load_elem ignoring the index when the inde


From: Jakob Löw
Subject: [Libjit] [PATCH] fix jit_insn_load_elem ignoring the index when the index is of type long
Date: Thu, 27 Jul 2017 21:59:09 +0200

This commit fixes the index passed to jit_insn_load_elem being ignored
when it is of type long or ulong.
---
 jit/jit-insn.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/jit/jit-insn.c b/jit/jit-insn.c
index 65d9038..9820685 100644
--- a/jit/jit-insn.c
+++ b/jit/jit-insn.c
@@ -1812,8 +1812,9 @@ jit_value_t jit_insn_load_elem
        if(jit_value_is_constant(index))
        {
                return jit_insn_load_relative
-                       (func, base_addr,
-                        jit_value_get_nint_constant(index) * size,
elem_type);
+                       (func, base_addr, jit_value_get_nint_constant(
+                               jit_insn_convert(func, index,
jit_type_nint, 0)) * size,
+                               elem_type);
        }
 
        /* See if we can use a special-case instruction */
-- 
2.11.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]