Mercurial > hg > octave-nkf
diff libinterp/parse-tree/oct-parse.in.yy @ 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 | 0925d1f6875e |
children | 09f0cb9cac7d |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -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