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
out-of-order assignment with strings causes segfault #716
Comments
scoder changed milestone from |
scoder commented There are two problems involved here: one is the missing None check that http://trac.cython.org/ticket/166 describes, the other problem is that initial assignments of a Another bug that flow control analysis could potentially fix... |
@dagss commented Would it be help to simply disable the ability to declare variables after they are used? This is rather easily checked without full flow control analysis. |
@robertwb commented Yes, I think we should disallow variable declarations after they are used. |
@robertwb changed milestone from |
@robertwb changed priority from This is a pretty bad bug, but it'll be more than a quick fix and it's not a regression so I don't want to hold up 0.11 for it. |
@dagss changed owner from |
@dagss commented Note that this is almost done, there's a patch on the mailing list. |
@dagss changed resolution to |
@dagss commented To be clear, this was fixed by making Hoyt's example raise a compilation error. |
@robertwb commented |
Hello,
In cython 1474:7f1b96cad687, the following code results in a segfault. It seems a relevant check for None is omitted because of the assignment, even though the assignment comes later.
When crash() is run, the program segfaults. However, the following code segments behave correctly, printing None.
and
Furthermore, assigning None to the s afterwards also causes it to crash (compare above).
Thanks!
--Hoyt
Migrated from http://trac.cython.org/ticket/158
The text was updated successfully, but these errors were encountered: