This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python] fix varobj crash


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]