X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/eb1b07409f0ccad9970c8a60ded9f2a56d205b9c..728c4be290a95081c272ca917c54987135cde7e3:/tests/push.at diff --git a/tests/push.at b/tests/push.at index 62593d3e..4a986290 100644 --- a/tests/push.at +++ b/tests/push.at @@ -52,24 +52,22 @@ yyerror (char const *msg) int main (void) { - yypstate *yyps; - YYSTYPE yylval; - - /* Make sure we don't try to free yyps->yyss in this case. */ - yyps = yypstate_new (); - yypstate_delete (yyps); - - /* yypstate_delete used to leak yyps->yyss if the stack was reallocated but - the parse did not return on success, syntax error, or memory - exhaustion. */ - yyps = yypstate_new (); - assert (yypush_parse (yyps, 'a', &yylval) == YYPUSH_MORE); - yypstate_delete (yyps); - - yyps = yypstate_new (); - assert (yypush_parse (yyps, 'a', &yylval) == YYPUSH_MORE); - assert (yypush_parse (yyps, 'b', &yylval) == YYPUSH_MORE); - yypstate_delete (yyps); + yypstate *ps; + + /* Make sure we don't try to free ps->yyss in this case. */ + ps = yypstate_new (); + yypstate_delete (ps); + + /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the + parse did not return on success, syntax error, or memory exhaustion. */ + ps = yypstate_new (); + assert (yypush_parse (ps, 'a', NULL) == YYPUSH_MORE); + yypstate_delete (ps); + + ps = yypstate_new (); + assert (yypush_parse (ps, 'a', NULL) == YYPUSH_MORE); + assert (yypush_parse (ps, 'b', NULL) == YYPUSH_MORE); + yypstate_delete (ps); return 0; }