Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 0.27.1 #1908

Closed
stefanmh opened this issue Oct 3, 2017 · 2 comments
Closed

Regression in 0.27.1 #1908

stefanmh opened this issue Oct 3, 2017 · 2 comments
Milestone

Comments

@stefanmh
Copy link

stefanmh commented Oct 3, 2017

The following testcase:

a.pxd

import cython
from cpython cimport array

cdef class A:
	@cython.locals(x='double[:]')
	cpdef f(self)

a.py

import array

class A():
	def f(self):
		a = array.array('d', [0.0])

Works in 0.27.0

$ pip install -U cython==0.27.0
$ rm a.c; cython a.py
$

Fails in 0.27.1

$ pip install -U cython==0.27.1
$ rm a.c; cython a.py

Error compiling Cython file:
------------------------------------------------------------
...
import cython
from cpython cimport array

cdef class A:
        @cython.locals(x='double[:]')
                 ^
------------------------------------------------------------

a.pxd:5:18: Compiler crash in AnalyseDeclarationsTransform

ModuleNode.body = StatListNode(a.py:1:0)
StatListNode.stats[1] = StatListNode(a.py:3:0)
StatListNode.stats[0] = CClassDefNode(a.py:3:0,
    class_name = u'A',
    visibility = 'private')
CClassDefNode.body = StatListNode(a.py:4:1)
StatListNode.stats[0] = CFuncDefNode(a.py:4:1,
    args = [...]/1,
    is_c_class_method = 1,
    modifiers = [...]/0,
    overridable = 1,
    visibility = 'private')
File 'ExprNodes.py', line 1589, in analyse_as_type: StringNode(a.pxd:5:18,
    is_literal = 1,
    is_string_literal = True,
    result_is_used = True,
    unicode_value = u'double[:]',
    use_managed_ref = True,
    value = 'double[:]')

Compiler crash traceback from this point on:
  File "***/Cython/Compiler/ExprNodes.py", line 1589, in analyse_as_type
    return _analyse_name_as_type(self.unicode_value or self.value.decode('ISO8859-1'), self.pos, env)
  File "***/Cython/Compiler/ExprNodes.py", line 1375, in _analyse_name_as_type
    return sizeof_node.arg_type.analyse_types(env)
AttributeError: 'NoneType' object has no attribute 'analyse_types'

@scoder scoder closed this as completed in 15ce8b9 Oct 3, 2017
@scoder scoder added this to the 0.27.2 milestone Oct 3, 2017
@scoder
Copy link
Contributor

scoder commented Oct 3, 2017

Thanks for the report and the short reproducer.

@stefanmh
Copy link
Author

stefanmh commented Oct 4, 2017

Thanks for addressing the issue so promptly ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants