Bladeren bron

Fixed segmentation fault in generated bison code.

Sander Mathijs van Veen 14 jaren geleden
bovenliggende
commit
f1e152a6c8
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  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"