Procházet zdrojové kódy

Fixed segmentation fault in generated bison code.

Sander Mathijs van Veen před 14 roky
rodič
revize
f1e152a6c8
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/pyrex/bison_.pyx

+ 1 - 1
src/pyrex/bison_.pyx

@@ -421,7 +421,7 @@ cdef class ParserEngine:
                         action = action + "             Py_INCREF(Py_None);\n"
                         action = action + "             yyclearin;\n"
 
-                    action = action + "          if (PyObject_HasAttrString($$, \"_pyBisonError\"))\n"
+                    action = action + "          if ($$ && $$ != Py_None && PyObject_HasAttrString($$, \"_pyBisonError\"))\n"
                     action = action + "          {\n"
                     action = action + "             yyerror(PyString_AsString(PyObject_GetAttrString(py_parser, \"lasterror\")));\n"
                     action = action + "             Py_INCREF(Py_None);\n"