From 62f3b3fb9a2fb1fe3d35c53d06a79d65d20d275c Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 12 Nov 2010 00:51:15 -0800 Subject: [PATCH] Buffer fix. --- Cython/Compiler/ExprNodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 23303655..0459938f 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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)) -- 2.26.2