From: Paul Eggert Date: Mon, 27 Aug 2001 17:24:34 +0000 (+0000) Subject: (yyparse): Don't take the address of an item before the start of an X-Git-Tag: pre-merge-of-1-29-branch~53 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/cbd8990652e961f8843b73b06a5760d0ac2a973a (yyparse): Don't take the address of an item before the start of an array, as that doesn't conform to the C Standard. --- diff --git a/src/bison.simple b/src/bison.simple index 2da7f273..26a6a019 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -483,11 +483,12 @@ int so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif + goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | @@ -496,7 +497,10 @@ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ - *++yyssp = yystate; + yyssp++; + +yysetstate: + *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) {