[pypy-svn] pypy default: Oops. Fix segfaults...

arigo commits-noreply at bitbucket.org
Wed Feb 16 10:26:01 CET 2011

Author: Armin Rigo <arigo at tunes.org>
Changeset: r42015:f7234a720b93
Date: 2011-02-16 10:25 +0100

Log:	Oops. Fix segfaults...

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -685,8 +685,9 @@
     def is_valid_for_map(self, map):
+        # note that 'map' can be None here
         mymap = self.map_wref()
-        if mymap is map:     # also handles the case self.map_wref()->None
+        if mymap is not None and mymap is map:
             version_tag = map.terminator.w_cls.version_tag()
             if version_tag is self.version_tag:
                 # everything matches, it's incredibly fast

More information about the Pypy-commit mailing list