This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] fix varobj crash
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Mon, 17 Aug 2009 12:57:20 -0600
- Subject: [python] fix varobj crash
- Reply-to: Tom Tromey <tromey at redhat dot com>
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;