Disallowing buffer indexing as for loop target, as it is not implemented.
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 21 Aug 2008 21:48:29 +0000 (23:48 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 21 Aug 2008 21:48:29 +0000 (23:48 +0200)
Cython/Compiler/Nodes.py

index 7eb3ede8faf80dd77b0e570410a6bf7ca139057b..c413c49dbc05605221770c1cf20e5f9e2899e2f0 100644 (file)
@@ -3297,6 +3297,8 @@ class ForFromStatNode(LoopNode, StatNode):
         #                      "Cannot assign integer to variable of type '%s'" % target_type)
         if target_type.is_numeric:
             self.is_py_target = 0
+            if isinstance(self.target, ExprNodes.IndexNode) and self.target.is_buffer_access:
+                raise error(self.pos, "Buffer indexing not allowed as for loop target.")
             self.loopvar_name = self.target.entry.cname
             self.py_loopvar_node = None
         else: