[pypy-dev] rlist and ll_delitem_nonneg index
zariko.taba at gmail.com
Fri Sep 23 14:37:12 CEST 2011
Hi pypy !
I hit an assert in pypy/annotation/annrpython.py in addpendingblock line 231
: assert annmodel.unionof(s_oldarg, s_newarg) == s_oldarg
I think I found an explanation by digging in code :
The treated block is in the "ll_delitem_nonneg" function,
s_newarg is a "SomeInteger(nonneg=True)" and s_oldarg is a
and in fact they are the "index" argument of this function.
oldarg comes from a previous annotation using the "rtype_method_remove" of
"rtype_method_remove" use "ll_listremove" which use :
Looking at ll_listindex, it seems clear that the index can be proved as
That's probably why s_oldarg is a "SomeInteger(nonneg=True)"
The new annotation comes from the method "rtype_delitem" (class __extend__
the index from hop is always positive, so the code :
llfn = ll_delitem_nonneg
select "ll_delitem_nonneg" as the deletion function.
But the index given to the annotator is taken from :
v_lst, v_index = hop.inputargs(r_lst, Signed)
v_index is a "Signed"
The information concerning the "non negative" property of the index integer
is lost here.
index is now "SomeInteger(nonneg=False)" and trigs the assert.
What do you think ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pypy-dev