indent(1): Avoid out-of-bound accesses of array ps.p_stack.
Submitted by: Piotr Stefaniak
This commit is contained in:
parent
0bae80a336
commit
488f148604
@ -172,7 +172,7 @@ parse(int tk) /* tk: the code for the construct scanned */
|
||||
|
||||
case rbrace: /* scanned a } */
|
||||
/* stack should have <lbrace> <stmt> or <lbrace> <stmtl> */
|
||||
if (ps.p_stack[ps.tos - 1] == lbrace) {
|
||||
if (ps.tos > 0 && ps.p_stack[ps.tos - 1] == lbrace) {
|
||||
ps.ind_level = ps.i_l_follow = ps.il[--ps.tos];
|
||||
ps.p_stack[ps.tos] = stmt;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user