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

internal compiler error if first argument of cpdef method has type "int" #609

Closed
robertwb opened this issue Aug 16, 2008 · 2 comments
Closed

Comments

@robertwb
Copy link
Contributor

The following (invalid) code:

cdef class Foo:
    cpdef foo(int i):
        return None

gives this error message:

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef class Foo:
    cpdef foo(int i):
         ^
------------------------------------------------------------

/tmp/foo.pyx:2:10: Self argument of C method does not match parent type
Traceback (most recent call last):
  File "/usr/bin/cython", line 8, in <module>
    main(command_line = 1)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Main.py", line 527, in main
    result = compile(sources, options)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Main.py", line 505, in compile
    return compile_multiple(source, options)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Main.py", line 472, in compile_multiple
    result = context.compile(source, options)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Main.py", line 327, in compile
    tree.process_implementation(scope, options, result)
  File "/var/lib/python-support/python2.5/Cython/Compiler/ModuleNode.py", line 59, in process_implementation
    self.generate_c_code(env, options, result)
  File "/var/lib/python-support/python2.5/Cython/Compiler/ModuleNode.py", line 243, in generate_c_code
    self.body.generate_function_definitions(env, code, options.transforms)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Nodes.py", line 2051, in generate_function_definitions
    self.entry.type.scope, code, transforms)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Nodes.py", line 928, in generate_function_definitions
    self.py_func.generate_function_definitions(env, code, transforms)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Nodes.py", line 820, in generate_function_definitions
    self.body.analyse_expressions(lenv)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Nodes.py", line 2601, in analyse_expressions
    self.value.allocate_temps(env)
  File "/var/lib/python-support/python2.5/Cython/Compiler/ExprNodes.py", line 347, in allocate_temps
    self.release_subexpr_temps(env)
  File "/var/lib/python-support/python2.5/Cython/Compiler/ExprNodes.py", line 412, in release_subexpr_temps
    node.release_temp(env)
  File "/var/lib/python-support/python2.5/Cython/Compiler/ExprNodes.py", line 403, in release_temp
    env.release_temp(self.result_code)
  File "/var/lib/python-support/python2.5/Cython/Compiler/Symtab.py", line 585, in release_temp
    % cname)
Cython.Compiler.Errors.InternalError: Internal compiler error: Temporary variable __pyx_2 released more than once

This is probably another instance of the sort of problem described recently on the Cython mailing list in the thread "Errors and pipelines", where Cython reports an error and then crashes later because something is internally inconsistent after the first error.

I didn't even notice the first, correct error,

/tmp/foo.pyx:2:10: Self argument of C method does not match parent type

until I was in the process of constructing this bug report.

Migrated from http://trac.cython.org/ticket/52

@robertwb
Copy link
Contributor Author

@robertwb changed resolution to fixed
status from new to closed
commented

OK, I've fixed this.

@robertwb
Copy link
Contributor Author

@robertwb changed milestone to 0.9.8.1
commented

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

No branches or pull requests

1 participant