* [python] fix varobj crash
@ 2009-08-17 18:57 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2009-08-17 18:57 UTC (permalink / raw)
To: Project Archer
I'm checking this in on the python branch.
This fixes a crash that Vladimir reported.
We shouldn't call value_incref on NULL.
Tom
2009-08-17 Tom Tromey <tromey@redhat.com>
* varobj.c (install_new_value): Conditionally call value_incref.
diff --git a/gdb/varobj.c b/gdb/varobj.c
index c8cf277..c64c628 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1518,7 +1518,8 @@ install_new_value (struct varobj *var, struct value *value, int initial)
if (var->value != NULL && var->value != value)
value_free (var->value);
var->value = value;
- value_incref (value);
+ if (value != NULL)
+ value_incref (value);
if (var->print_value)
xfree (var->print_value);
var->print_value = print_value;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-17 18:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17 18:57 [python] fix varobj crash Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).