Author: Armin Rigo <ar...@tunes.org>
Branch: stmgc-c7
Changeset: r70305:09f9774d8d28
Date: 2014-03-27 15:26 +0100
http://bitbucket.org/pypy/pypy/changeset/09f9774d8d28/

Log:    cast_ptr_to_int on non-gc objects is by itself not dangerous

diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -666,6 +666,7 @@
     OP_CAST_ADR_TO_PTR = OP_CAST_POINTER
     OP_CAST_OPAQUE_PTR = OP_CAST_POINTER
     OP_CAST_PTR_TO_ADR = OP_CAST_POINTER
+    OP_CAST_PTR_TO_INT = OP_CAST_POINTER
 
     def OP_CAST_INT_TO_PTR(self, op):
         TYPE = self.lltypemap(op.result)
diff --git a/rpython/translator/c/src/int.h b/rpython/translator/c/src/int.h
--- a/rpython/translator/c/src/int.h
+++ b/rpython/translator/c/src/int.h
@@ -224,7 +224,6 @@
 #define OP_CAST_INT_TO_LONGLONGLONG(x,r) r = (__int128)(x)
 #define OP_CAST_CHAR_TO_INT(x,r)    r = (Signed)((unsigned char)(x))
 #define OP_CAST_INT_TO_CHAR(x,r)    r = (char)(x)
-#define OP_CAST_PTR_TO_INT(x,r)     r = (Signed)(x)
 #define OP_CAST_CURRENT_PTR_TO_INT(x,r)  r = (Signed)(x)
 
 #define OP_TRUNCATE_LONGLONG_TO_INT(x,r) r = (Signed)(x)
diff --git a/rpython/translator/stm/inevitable.py 
b/rpython/translator/stm/inevitable.py
--- a/rpython/translator/stm/inevitable.py
+++ b/rpython/translator/stm/inevitable.py
@@ -12,6 +12,7 @@
     'cast_opaque_ptr', 'hint',
     'stack_current', 'gc_stack_bottom',
     'cast_current_ptr_to_int',   # this variant of 'cast_ptr_to_int' is ok
+    'cast_ptr_to_int',           # only for non-gc, crashes in genc for gc
     'jit_force_virtual', 'jit_force_virtualizable',
     'jit_force_quasi_immutable', 'jit_marker', 'jit_is_virtual',
     'jit_record_known_class',
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to