Commit aae7c63c authored by Sean McBride's avatar Sean McBride
Browse files

Fixed cppcheck null deref warning

parent 13f8a0d4
......@@ -9694,17 +9694,15 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
yyGLRState** yynewStates;
yybool* yynewLookaheadNeeds;
yynewStates = YY_NULLPTR;
if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
> (YYSIZEMAX / (2 * sizeof (yyGLRState*))))
yyMemoryExhausted (yystackp);
yystackp->yytops.yycapacity *= 2;
yynewStates =
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
(yystackp->yytops.yycapacity
* sizeof yynewStates[0]));
* sizeof (yyGLRState*)));
if (yynewStates == YY_NULLPTR)
yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates;
......
......@@ -29,6 +29,8 @@ Modify vtkParse.tab.c:
- remove YY_ATTRIBUTE_UNUSED from yyfillin, yyfill, and yynormal
- remove the "break;" after "return yyreportAmbiguity"
- replace "(1-yyrhslen)" with "(1-(int)yyrhslen)"
- remove dead store "yynewStates = YY_NULLPTR;"
- replace "sizeof yynewStates[0] with "sizeof (yyGLRState*)"
*/
/*
......
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