]> ocean-lang.org Git - ocean/commitdiff
parsergen: ensure value returned from parser_run is initialised.
authorNeilBrown <neil@brown.name>
Sat, 31 May 2014 10:14:01 +0000 (20:14 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 15 Jun 2014 07:20:44 +0000 (17:20 +1000)
If we don't accept the program, we currently return an uninitialized
value.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index f8d8a39c47a8861a079135d6d3753b10b4ddc482..81121430f9b3e6e7c31c1c99aa656e1e3498c281 100644 (file)
@@ -2579,7 +2579,7 @@ since the last state which could have been at the start of a line.
                struct parser p = { 0 };
                struct token *tk = NULL;
                int accepted = 0;
-               void *ret;
+               void *ret = NULL;
 
                p.next.newline_permitted = states[0].starts_line;
                while (!accepted) {