Buffer fix.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 12 Nov 2010 08:51:15 +0000 (00:51 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 12 Nov 2010 08:51:15 +0000 (00:51 -0800)
Cython/Compiler/ExprNodes.py

index 233036553d5a18abb233dcd12a7c5bce1b9e8115..0459938f07aec987369765b69277eef612338f22 100755 (executable)
@@ -2070,7 +2070,6 @@ class IndexNode(ExprNode):
         skip_child_analysis = False
         buffer_access = False
         if self.base.type.is_buffer:
-            assert hasattr(self.base, "entry") # Must be a NameNode-like node
             if self.indices:
                 indices = self.indices
             else:
@@ -2085,6 +2084,8 @@ class IndexNode(ExprNode):
                     x.analyse_types(env)
                     if not x.type.is_int:
                         buffer_access = False
+            if buffer_access:
+                assert hasattr(self.base, "entry") # Must be a NameNode-like node
 
         # On cloning, indices is cloned. Otherwise, unpack index into indices
         assert not (buffer_access and isinstance(self.index, CloneNode))