Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r55093:063cfdcec5f0
Date: 2012-05-15 11:01 +0200
http://bitbucket.org/pypy/pypy/changeset/063cfdcec5f0/

Log:    enforce nonnegative ints here

diff --git a/pypy/rpython/lltypesystem/rffi.py 
b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -810,13 +810,14 @@
             b.append(cp[i])
             i += 1
         return assert_str0(b.build())
+    charp2strn._annenforceargs_ = [None, annmodel.SomeInteger(nonneg=True)]
 
     # char* and size -> str (which can contain null bytes)
     def charpsize2str(cp, size):
         b = builder_class(size)
         b.append_charpsize(cp, size)
         return b.build()
-    charpsize2str._annenforceargs_ = [None, int]
+    charpsize2str._annenforceargs_ = [None, annmodel.SomeInteger(nonneg=True)]
 
     return (str2charp, free_charp, charp2str,
             get_nonmovingbuffer, free_nonmovingbuffer,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to