From 7e871646101da1dcf20fa09cd21cb614edc27f88 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Wed, 3 Sep 2008 16:51:34 +0200 Subject: [PATCH] Buffers: Fix a segfault (would only occur under exceptional circumstances) --- Cython/Compiler/Nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 7eb3ede8..b1d53b8c 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -913,6 +913,8 @@ class FuncDefNode(StatNode, BlockNode): for entry in lenv.var_entries: if entry.type.is_pyobject and entry.init_to_none and entry.used: 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: code.putln("%s.buf = NULL;" % entry.buffer_aux.buffer_info_var.cname) # ----- Check and convert arguments -- 2.26.2