Buffers: Fix a segfault (would only occur under exceptional circumstances)
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 3 Sep 2008 14:51:34 +0000 (16:51 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 3 Sep 2008 14:51:34 +0000 (16:51 +0200)
Cython/Compiler/Nodes.py

index 7eb3ede8faf80dd77b0e570410a6bf7ca139057b..b1d53b8c91dfc0e57f2b5e02ab0f071c4adf536e 100644 (file)
@@ -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