Fix crash in is_nocall_function

is_nocall_function anticipates only being called for a function or a
method.  However, PR gdb/29871 points out a situation where an unusual
expression -- but one that parses to a valid, if extremely weird,
function call -- breaks this assumption.

This patch changes is_nocall_function to remove this assert and
instead simply return 'false' in this case.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29871
This commit is contained in:
Tom Tromey
2022-12-11 12:48:07 -07:00
parent d0d41b77c0
commit 785545988c
3 changed files with 7 additions and 5 deletions

View File

@@ -2845,9 +2845,7 @@ extern unsigned int overload_debug;
to call by the debugger.
This usually indicates that the function does not follow the target's
standard calling convention.
The TYPE argument must be of code TYPE_CODE_FUNC or TYPE_CODE_METHOD. */
standard calling convention. */
extern bool is_nocall_function (const struct type *type);