summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-09-07 15:30:36 +0200
committerWim Taymans <wtaymans@redhat.com>2015-09-07 15:33:17 +0200
commitc367007e133a53b0d821c0423bc6bc860afd799e (patch)
tree13ac2dc2d235094910ef84b4a20891e6abac9e5e
parente2466ae79277140d483f8b593c5a994b11fc93c0 (diff)
executor: fix load of parameters smaller than 64 bits1.61.4
Parameters less than 64 bits are passed in just one param register. Fixes crashes on ldresnearb and friends in emulated code.
-rw-r--r--orc/orcexecutor.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/orc/orcexecutor.c b/orc/orcexecutor.c
index 6fe296d..6306d34 100644
--- a/orc/orcexecutor.c
+++ b/orc/orcexecutor.c
@@ -295,10 +295,15 @@ orc_executor_emulate (OrcExecutor *ex)
} else if (var->vartype == ORC_VAR_TYPE_PARAM) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
/* FIXME hack */
- load_constant (tmpspace[insn->src_args[k]], 8,
- (orc_uint64)(orc_uint32)ex->params[insn->src_args[k]] |
- (((orc_uint64)(orc_uint32)ex->params[insn->src_args[k] +
- (ORC_VAR_T1 - ORC_VAR_P1)])<<32));
+ if (var->size == 8) {
+ load_constant (tmpspace[insn->src_args[k]], 8,
+ (orc_uint64)(orc_uint32)ex->params[insn->src_args[k]] |
+ (((orc_uint64)(orc_uint32)ex->params[insn->src_args[k] +
+ (ORC_VAR_T1 - ORC_VAR_P1)])<<32));
+ } else {
+ load_constant (tmpspace[insn->src_args[k]], 8,
+ ex->params[insn->src_args[k]]);
+ }
} else if (var->vartype == ORC_VAR_TYPE_TEMP) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
} else if (var->vartype == ORC_VAR_TYPE_SRC) {