Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r44814:ad56f6708cad Date: 2011-06-07 17:08 +0200 http://bitbucket.org/pypy/pypy/changeset/ad56f6708cad/
Log: Fix for a571136cc78e. diff --git a/pypy/annotation/bookkeeper.py b/pypy/annotation/bookkeeper.py --- a/pypy/annotation/bookkeeper.py +++ b/pypy/annotation/bookkeeper.py @@ -279,13 +279,13 @@ desc = self.getdesc(cls) return desc.getuniqueclassdef() - def getlistdef(self, **flags): + def getlistdef(self, **flags_if_new): """Get the ListDef associated with the current position.""" try: listdef = self.listdefs[self.position_key] except KeyError: listdef = self.listdefs[self.position_key] = ListDef(self) - listdef.listitem.__dict__.update(flags) + listdef.listitem.__dict__.update(flags_if_new) return listdef def newlist(self, *s_values, **flags): @@ -294,6 +294,9 @@ listdef = self.getlistdef(**flags) for s_value in s_values: listdef.generalize(s_value) + if flags: + assert flags.keys() == ['range_step'] + listdef.generalize_range_step(flags['range_step']) return SomeList(listdef) def getdictdef(self, is_r_dict=False): diff --git a/pypy/annotation/listdef.py b/pypy/annotation/listdef.py --- a/pypy/annotation/listdef.py +++ b/pypy/annotation/listdef.py @@ -184,6 +184,11 @@ def generalize(self, s_value): self.listitem.generalize(s_value) + def generalize_range_step(self, range_step): + newlistitem = ListItem(self.listitem.bookkeeper, s_ImpossibleValue) + newlistitem.range_step = range_step + self.listitem.merge(newlistitem) + def __repr__(self): return '<[%r]%s%s%s%s>' % (self.listitem.s_value, self.listitem.mutated and 'm' or '', _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit