Ticket #158 (closed defect: fixed)
out-of-order assignment with strings causes segfault
| Reported by: | hoytak | Owned by: | Kurt Smith |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.11.1 |
| Component: | Code Generation | Keywords: | |
| Cc: |
Description
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.
def crash():
print "%s" % s
cdef str s = "Test"
When crash() is run, the program segfaults. However, the following code segments behave correctly, printing None.
def nocrash():
print "%s" % s
cdef str s
and
def nocrash():
cdef str s = None
print "%s" % s
Furthermore, assigning None to the s afterwards also causes it to crash (compare above).
def crash():
print "%s" % s
cdef str s = None
Thanks! --Hoyt
Change History
Note: See
TracTickets for help on using
tickets.
