changeset 23635:b5a9cd6de1b8

avoid possible memory error in parser * oct-parse.in.yy (opt_fcn_list): For empty list case, return allocated emtpy tree_statement_list instead of 0.
author John W. Eaton <jwe@octave.org>
date Sat, 17 Jun 2017 20:08:06 -0400
parents ff68c9d024b8
children 563a9fc1ef23
files libinterp/parse-tree/oct-parse.in.yy
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Sat Jun 17 10:26:38 2017 -0700
+++ b/libinterp/parse-tree/oct-parse.in.yy	Sat Jun 17 20:08:06 2017 -0400
@@ -436,7 +436,7 @@
                 ;
 
 opt_fcn_list    : // empty
-                  { $$ = 0; }
+                  { $$ = new octave::tree_statement_list (); }
                 | fcn_list
                   { $$ = $1; }
                 ;