shift() returns 0 on failure, not negative.
Signed-off-by: NeilBrown <neilb@suse.de>
* Then we discard input tokens until
* we find one that is acceptable.
*/
* Then we discard input tokens until
* we find one that is acceptable.
*/
- while (shift(&p, TK_error, tk, states) < 0
+ while (shift(&p, TK_error, tk, states) == 0
&& p.tos > 0)
// discard this state
pop(&p, 1, do_free);
&& p.tos > 0)
// discard this state
pop(&p, 1, do_free);