diff options
author | Tom Tromey <tom@tromey.com> | 2024-03-27 10:34:46 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-03-28 16:28:50 -0600 |
commit | edada1692cc4558138756eea99532d83b7b894e0 (patch) | |
tree | b83b3306d3c878bf70582a403a5c16b923d103a8 /gdb/python/python-config.py | |
parent | e67388a6a475ab1ddaac596f9995789363f1f10c (diff) | |
download | binutils-edada1692cc4558138756eea99532d83b7b894e0.zip binutils-edada1692cc4558138756eea99532d83b7b894e0.tar.gz binutils-edada1692cc4558138756eea99532d83b7b894e0.tar.bz2 |
Make pascal_language::print_type handle varstring==nullptr
PR gdb/31524 points out a crash when pascal_language::print_type is
called with varstring==nullptr. This crash is a regression arising
from the printf/pager rewrite -- that indirectly removed a NULL check
from gdb's "puts".
This patch instead fixes the problem by adding a check to print_type.
Passing nullptr here seems to be expected in other places (e.g., there
is a call to type_print like this in expprint.c), and other
implementations of this method (or related helpers) explicitly check
for NULL.
I didn't write a test case for this because it seemed like overkill
for a Pascal bug that only occurs with -i=mi. However, if you want
one, let me know and I will do it.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31524
Approved-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/python/python-config.py')
0 files changed, 0 insertions, 0 deletions