Commit 6689e031 authored by Mark Florisson's avatar Mark Florisson

Debugger: fix is_initialized to avoid segfaults with cy exec

parent d6027cb2
...@@ -389,20 +389,19 @@ class CythonBase(object): ...@@ -389,20 +389,19 @@ class CythonBase(object):
value) value)
def is_initialized(self, cython_func, local_name): def is_initialized(self, cython_func, local_name):
islocal = local_name in cython_func.locals cyvar = cython_func.locals[local_name]
if islocal:
cyvar = cython_func.locals[local_name]
if '->' in cyvar.cname:
# Closed over free variable
if self.get_cython_lineno() >= cython_func.lineno + 1:
if cyvar.type == PythonObject:
return long(gdb.parse_and_eval(cyvar.cname))
return True
return False
cur_lineno = self.get_cython_lineno() cur_lineno = self.get_cython_lineno()
return (local_name in cython_func.arguments or
(islocal and cur_lineno > cyvar.lineno)) if '->' in cyvar.cname:
# Closed over free variable
if cur_lineno > cython_func.lineno:
if cyvar.type == PythonObject:
return long(gdb.parse_and_eval(cyvar.cname))
return True
return False
return cur_lineno > cyvar.lineno
class SourceFileDescriptor(object): class SourceFileDescriptor(object):
def __init__(self, filename, lexer, formatter=None): def __init__(self, filename, lexer, formatter=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment