diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/parse.c | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9731c99..1a3cc6c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2018-10-03 Tom Tromey <tom@tromey.com> + * parse.c (prefixify_expression): Add assert. + (parse_exp_in_context_1): Throw exception if the expression is + empty. + +2018-10-03 Tom Tromey <tom@tromey.com> + * dwarf2read.c (read_signed_leb128): Work in ULONGEST. 2018-10-03 Tom Tromey <tom@tromey.com> @@ -14219,7 +14225,7 @@ Update copyright year range in all GDB files. -2018-01-01 Joel Brobecker <brobecker@adacore.com> +2018-01-01, 18 Joel Brobecker <brobecker@adacore.com> * copyright.py (BY_HAND): Remove gdb/testsuite/gdb.base/step-line.inp and gdb/testsuite/gdb.base/step-line.c. diff --git a/gdb/parse.c b/gdb/parse.c index 163852c..8a128a7 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -792,6 +792,7 @@ copy_name (struct stoken token) int prefixify_expression (struct expression *expr) { + gdb_assert (expr->nelts > 0); int len = sizeof (struct expression) + EXP_ELEM_TO_BYTES (expr->nelts); struct expression *temp; int inpos = expr->nelts, outpos = 0; @@ -1205,7 +1206,10 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc, } CATCH (except, RETURN_MASK_ALL) { - if (! parse_completion) + /* If parsing for completion, allow this to succeed; but if no + expression elements have been written, then there's nothing + to do, so fail. */ + if (! parse_completion || ps.expout_ptr == 0) throw_exception (except); } END_CATCH |