]> ocean-lang.org Git - ocean/commitdiff
parsergen: fix bug testing return value for shift()
authorNeilBrown <neilb@suse.de>
Sun, 21 Jul 2013 08:00:13 +0000 (18:00 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 21 Jul 2013 08:17:24 +0000 (18:17 +1000)
shift() returns 0 on failure, not negative.

Signed-off-by: NeilBrown <neilb@suse.de>
csrc/parsergen.mdc

index 5d5ea1ebc352b13eacfd809a11416ce1ba2e5e18..2c2e2a66dba6a90035a0d7584537bc0c0f978c5a 100644 (file)
@@ -2408,7 +2408,7 @@ We return whatever `asn` was returned by reducing production zero.
                         * 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);