X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/91661ebbe3c3fcf5269cc544f308199ca4ef582c..5d31a2162dc41b71b9de73a3acb7fcba6fb8e7f3:/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; }