mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
glr2.cc: fix container out-of-bounds access
Clang 10 with ASAN enabled reported errors in glr2.cc. * data/skeletons/glr2.cc: here.
This commit is contained in:
committed by
Akim Demaille
parent
34476c449a
commit
27b5d92563
@@ -2273,12 +2273,13 @@ public:
|
||||
{
|
||||
/* Standard special case: single stack. */
|
||||
YYASSERT (yyk.get() == 0);
|
||||
glr_stack_item* yyrhs = yystateStack.topAt(yyk)->asItem();
|
||||
glr_stack_item* yyrhs = yystateStack.firstTop()->asItem();
|
||||
YY_REDUCE_PRINT ((true, yyrhs, yyk, yyrule, yyparser]b4_user_args[));
|
||||
YYRESULTTAG res = yyuserAction (yyrule, yynrhs, yyrhs,
|
||||
yyvalp]b4_locations_if([, yylocp])[);
|
||||
yystateStack.pop_back(static_cast<size_t>(yynrhs));
|
||||
yystateStack.setFirstTop(&yystateStack[yystateStack.size() - 1].getState());
|
||||
YY_REDUCE_PRINT ((true, yyrhs, yyk, yyrule, yyparser]b4_user_args[));
|
||||
return yyuserAction (yyrule, yynrhs, yyrhs,
|
||||
yyvalp]b4_locations_if([, yylocp])[);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user