diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-09-19 09:45:32 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-09-19 10:14:10 +0200 |
| commit | 1847269c7ee45a8c5e89b8cd2bc8eb731f55b81e (patch) | |
| tree | 5f29052c8762174c25af2955a664a85e4a0b5dd6 /miasm2/jitter/arch/JitCore_x86.c | |
| parent | 1b477380792d2b3e045d2f851cc9de01f9452b5a (diff) | |
| download | miasm-1847269c7ee45a8c5e89b8cd2bc8eb731f55b81e.tar.gz miasm-1847269c7ee45a8c5e89b8cd2bc8eb731f55b81e.zip | |
JitCore: Fix bn to reg convertion
Diffstat (limited to 'miasm2/jitter/arch/JitCore_x86.c')
| -rw-r--r-- | miasm2/jitter/arch/JitCore_x86.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/miasm2/jitter/arch/JitCore_x86.c b/miasm2/jitter/arch/JitCore_x86.c index b8d8270d..4e52ec85 100644 --- a/miasm2/jitter/arch/JitCore_x86.c +++ b/miasm2/jitter/arch/JitCore_x86.c @@ -220,6 +220,7 @@ PyObject* cpu_set_gpreg(JitCpu* self, PyObject *args) py_long = PyLong_FromLong((long)tmp); } else if (PyLong_Check(py_long)){ /* Already PyLong */ + /* Increment ref as we will decement it next */ Py_INCREF(py_long); } else{ @@ -227,7 +228,6 @@ PyObject* cpu_set_gpreg(JitCpu* self, PyObject *args) } - cst_ffffffff = PyLong_FromLong(0xffffffff); cst_32 = PyLong_FromLong(32); bn = bignum_from_int(0); @@ -246,10 +246,7 @@ PyObject* cpu_set_gpreg(JitCpu* self, PyObject *args) Py_DECREF(py_long); Py_DECREF(cst_32); Py_DECREF(cst_ffffffff); - - - - *(bn_t*)(((char*)(self->cpu)) + gpreg_dict[i].offset) = bn; + *(bn_t*)(((char*)(self->cpu)) + gpreg_dict[i].offset) = bignum_mask(bn, 128); } break; } |