about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <fabrice.desclaux@cea.fr>2016-05-30 23:46:37 +0200
committerserpilliere <fabrice.desclaux@cea.fr>2016-05-31 00:18:16 +0200
commit1ca15c6f38fbc509f826ea2961fd079bc764729a (patch)
treec420d67d09caaa26d8a693510e5376761349fba8
parent9815a1c01745143cceda9125e04b8d1d7b1d39fc (diff)
downloadmiasm-1ca15c6f38fbc509f826ea2961fd079bc764729a.tar.gz
miasm-1ca15c6f38fbc509f826ea2961fd079bc764729a.zip
Jitter: fix function cast
-rw-r--r--miasm2/jitter/Jitgcc.c3
-rw-r--r--miasm2/jitter/Jittcc.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/miasm2/jitter/Jitgcc.c b/miasm2/jitter/Jitgcc.c
index 3e7225cb..8b789f70 100644
--- a/miasm2/jitter/Jitgcc.c
+++ b/miasm2/jitter/Jitgcc.c
@@ -35,7 +35,7 @@ PyObject* gcc_exec_bloc(PyObject* self, PyObject* args)
 		// Get the expected jitted function address
 		func_py = PyDict_GetItem(lbl2ptr, retaddr);
 		if (func_py)
-			func = (jitted_func) PyInt_AsLong((PyObject*) func_py);
+			func = (jitted_func) PyLong_AsVoidPtr((PyObject*) func_py);
 		else {
 			if (BlockDst.is_local == 1) {
 				fprintf(stderr, "return on local label!\n");
@@ -44,7 +44,6 @@ PyObject* gcc_exec_bloc(PyObject* self, PyObject* args)
 			// retaddr is not jitted yet
 			return retaddr;
 		}
-
 		// Execute it
 		status = func(&BlockDst, jitcpu);
 		Py_DECREF(retaddr);
diff --git a/miasm2/jitter/Jittcc.c b/miasm2/jitter/Jittcc.c
index 201f9b7f..1acbd56f 100644
--- a/miasm2/jitter/Jittcc.c
+++ b/miasm2/jitter/Jittcc.c
@@ -154,7 +154,7 @@ PyObject* tcc_exec_bloc(PyObject* self, PyObject* args)
 		// Get the expected jitted function address
 		func_py = PyDict_GetItem(lbl2ptr, retaddr);
 		if (func_py)
-			func = (jitted_func) PyInt_AsLong((PyObject*) func_py);
+			func = (jitted_func) PyLong_AsVoidPtr((PyObject*) func_py);
 		else {
 			if (BlockDst.is_local == 1) {
 				fprintf(stderr, "return on local label!\n");