[pypy-commit] pypy py3.6-sandbox-2: hg merge sandbox-2

arigo pypy.commits at gmail.com
Mon Aug 26 11:27:53 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6-sandbox-2
Changeset: r97274:842a1a1386b0
Date: 2019-08-26 17:24 +0200
http://bitbucket.org/pypy/pypy/changeset/842a1a1386b0/

Log:	hg merge sandbox-2

diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -920,9 +920,11 @@
         w_array._charbuf_stop()
         return char
 
+    @sandbox_review(reviewed=True)
     def setitem(self, index, char):
         w_array = self.w_array
         data = w_array._charbuf_start()
+        assert 0 <= index < w_array.len
         data[index] = char
         w_array._charbuf_stop()
 
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -1482,6 +1482,7 @@
         calling_conv='win')
 
 
+ at sandbox_review(reviewed=True)
 @replace_os_function('utime')
 @specialize.argtype(0, 1)
 def utime(path, times):
@@ -1540,11 +1541,13 @@
             lltype.free(atime, flavor='raw')
             lltype.free(mtime, flavor='raw')
 
+ at sandbox_review(check_caller=True)
 def times_to_timeval2p(times, l_timeval2p):
     actime, modtime = times
     _time_to_timeval(actime, l_timeval2p[0])
     _time_to_timeval(modtime, l_timeval2p[1])
 
+ at sandbox_review(check_caller=True)
 def _time_to_timeval(t, l_timeval):
     import math
     fracpart, intpart = math.modf(t)
@@ -2255,6 +2258,7 @@
         [rffi.CCHARP, TIMEVAL2P], rffi.INT,
         save_err=rffi.RFFI_SAVE_ERRNO)
 
+    @sandbox_review(reviewed=True)
     @specialize.argtype(1)
     def lutimes(pathname, times):
         if times is None:
@@ -2270,6 +2274,7 @@
         [rffi.INT, TIMEVAL2P], rffi.INT,
         save_err=rffi.RFFI_SAVE_ERRNO)
 
+    @sandbox_review(reviewed=True)
     @specialize.argtype(1)
     def futimes(fd, times):
         if times is None:
diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -1450,6 +1450,7 @@
 # NOTE: This is not a weak key dictionary, thus keeping a lot of stuff alive.
 TEST_RAW_ADDR_KEEP_ALIVE = {}
 
+ at sandbox_review(reviewed=True)
 @jit.dont_look_inside
 def get_raw_address_of_string(string):
     """Returns a 'char *' that is valid as long as the rpython string object is alive.
diff --git a/rpython/translator/sandbox/graphchecker.py b/rpython/translator/sandbox/graphchecker.py
--- a/rpython/translator/sandbox/graphchecker.py
+++ b/rpython/translator/sandbox/graphchecker.py
@@ -21,7 +21,8 @@
     'malloc', 'malloc_varsize', 'free',
     'getfield', 'getarrayitem', 'getinteriorfield', 'raw_load',
     'cast_opaque_ptr', 'cast_ptr_to_int',
-    'gc_thread_run', 'gc_stack_bottom', 'gc_thread_after_fork',
+    'gc_thread_run', 'gc_stack_bottom',
+    'gc_thread_before_fork', 'gc_thread_after_fork',
     'shrink_array', 'gc_pin', 'gc_unpin', 'gc_can_move', 'gc_id',
     'gc_identityhash', 'weakref_create', 'weakref_deref',
     'gc_fq_register', 'gc_fq_next_dead',
@@ -103,8 +104,6 @@
 
             elif opname in ('cast_ptr_to_adr', 'force_cast',
                             'cast_int_to_ptr'):
-                if is_gc_ptr(op.args[0].concretetype):
-                    return "argument is a GC ptr: %r" % (opname,)
                 if is_gc_ptr(op.result.concretetype):
                     return "result is a GC ptr: %r" % (opname,)
 


More information about the pypy-commit mailing list