From 7fdf5d61c90e76632fdf09641c9d586290435717 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Tue, 5 Aug 2008 18:34:19 +0200 Subject: [PATCH] Fixed another bug with [] indexing --- Cython/Compiler/Parsing.py | 2 +- tests/compile/arrayargs.pyx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 98b3fdff..1f733893 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1629,7 +1629,7 @@ def p_buffer_access(s, base_type_node): # s.sy == '[' pos = s.position() s.next() - if s.sy == ']': + if s.sy == ']' or s.sy == 'INT': # not buffer, could be [] on C type nameless array arguments s.put_back('[', '[') return base_type_node diff --git a/tests/compile/arrayargs.pyx b/tests/compile/arrayargs.pyx index 7a6429ec..2a18093e 100644 --- a/tests/compile/arrayargs.pyx +++ b/tests/compile/arrayargs.pyx @@ -11,3 +11,9 @@ cdef extern from *: ctypedef MyStruct* MyStructP cdef void baz(MyStructP[]) + +cdef struct OtherStruct: + int a + +a = sizeof(int[23][34]) +b = sizeof(OtherStruct[43]) -- 2.26.2