diff options
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; } |