From: Dag Sverre Seljebotn Date: Tue, 5 Aug 2008 16:34:19 +0000 (+0200) Subject: Fixed another bug with [] indexing X-Git-Tag: 0.9.8.1~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7fdf5d61c90e76632fdf09641c9d586290435717;p=cython.git Fixed another bug with [] indexing --- 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])