diff options
author | Wim Taymans <wtaymans@redhat.com> | 2015-09-07 15:30:36 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2015-09-07 15:33:17 +0200 |
commit | c367007e133a53b0d821c0423bc6bc860afd799e (patch) | |
tree | 13ac2dc2d235094910ef84b4a20891e6abac9e5e | |
parent | e2466ae79277140d483f8b593c5a994b11fc93c0 (diff) |
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.c | 13 |
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) { |