changeset 16302:a4af67e0d22c

oct-parse.in.yy: a{~}.b segfaults the interpreter (bug #37804)
author Max Brister <max@2bass.com>
date Thu, 14 Mar 2013 03:48:47 -0600
parents d39342a19fb8
children 085976d9ef08
files libinterp/parse-tree/oct-parse.in.yy
diffstat 1 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Wed Mar 13 16:05:07 2013 -0400
+++ b/libinterp/parse-tree/oct-parse.in.yy	Thu Mar 14 03:48:47 2013 -0600
@@ -380,7 +380,11 @@
 // WHILE, etc.
 
 word_list_cmd   : identifier word_list
-                  { $$ = parser.make_index_expression ($1, $2, '('); }
+                  {
+                    $$ = parser.make_index_expression ($1, $2, '(');
+                    if (! $$)
+                      ABORT_PARSE;
+                  }
                 ;
 
 word_list       : string
@@ -563,13 +567,29 @@
                 | oper_expr MINUS_MINUS
                   { $$ = parser.make_postfix_op (MINUS_MINUS, $1, $2); }
                 | oper_expr '(' ')'
-                  { $$ = parser.make_index_expression ($1, 0, '('); }
+                  {
+                    $$ = parser.make_index_expression ($1, 0, '(');
+                    if (! $$)
+                      ABORT_PARSE;
+                  }
                 | oper_expr '(' arg_list ')'
-                  { $$ = parser.make_index_expression ($1, $3, '('); }
+                  {
+                    $$ = parser.make_index_expression ($1, $3, '(');
+                    if (! $$)
+                      ABORT_PARSE;
+                  }
                 | oper_expr '{' '}'
-                  { $$ = parser.make_index_expression ($1, 0, '{'); }
+                  {
+                    $$ = parser.make_index_expression ($1, 0, '{');
+                    if (! $$)
+                      ABORT_PARSE;
+                  }
                 | oper_expr '{' arg_list '}'
-                  { $$ = parser.make_index_expression ($1, $3, '{'); }
+                  {
+                    $$ = parser.make_index_expression ($1, $3, '{');
+                    if (! $$)
+                      ABORT_PARSE;
+                  }
                 | oper_expr HERMITIAN
                   { $$ = parser.make_postfix_op (HERMITIAN, $1, $2); }
                 | oper_expr TRANSPOSE