Commit 7e871646 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Buffers: Fix a segfault (would only occur under exceptional circumstances)

parent 55cf301b
...@@ -913,6 +913,8 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -913,6 +913,8 @@ class FuncDefNode(StatNode, BlockNode):
for entry in lenv.var_entries: for entry in lenv.var_entries:
if entry.type.is_pyobject and entry.init_to_none and entry.used: if entry.type.is_pyobject and entry.init_to_none and entry.used:
code.put_init_var_to_py_none(entry) code.put_init_var_to_py_none(entry)
# ----- Initialise local buffer auxiliary variables
for entry in lenv.var_entries + lenv.arg_entries:
if entry.type.is_buffer and entry.buffer_aux.buffer_info_var.used: if entry.type.is_buffer and entry.buffer_aux.buffer_info_var.used:
code.putln("%s.buf = NULL;" % entry.buffer_aux.buffer_info_var.cname) code.putln("%s.buf = NULL;" % entry.buffer_aux.buffer_info_var.cname)
# ----- Check and convert arguments # ----- Check and convert arguments
......
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