From: NeilBrown Date: Sat, 31 May 2014 10:14:01 +0000 (+1000) Subject: parsergen: ensure value returned from parser_run is initialised. X-Git-Tag: workingparser~30 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=45d1dabd4202e5ad1713d34876ebb8efc5ac2655 parsergen: ensure value returned from parser_run is initialised. If we don't accept the program, we currently return an uninitialized value. Signed-off-by: NeilBrown --- diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index f8d8a39..8112143 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -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) {