PR python/14634:

* python/py-symbol.c (sympy_dealloc): Check for NULL symbol.
testsuite
	* gdb.python/py-symbol.exp: Test symbol destructor.
This commit is contained in:
Tom Tromey 2012-10-15 15:20:27 +00:00
parent b7a54b5525
commit 74f910c87c
4 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-10-15 Tom Tromey <tromey@redhat.com>
PR python/14634:
* python/py-symbol.c (sympy_dealloc): Check for NULL symbol.
2012-10-11 Andrew Burgess <aburgess@broadcom.com>
* remote-sim.c (gdbsim_create_inferior): Call init_thread_list to

View File

@ -335,7 +335,7 @@ sympy_dealloc (PyObject *obj)
if (sym_obj->prev)
sym_obj->prev->next = sym_obj->next;
else if (SYMBOL_SYMTAB (sym_obj->symbol))
else if (sym_obj->symbol && SYMBOL_SYMTAB (sym_obj->symbol))
{
set_objfile_data (SYMBOL_SYMTAB (sym_obj->symbol)->objfile,
sympy_objfile_data_key, sym_obj->next);

View File

@ -1,3 +1,7 @@
2012-10-15 Tom Tromey <tromey@redhat.com>
* gdb.python/py-symbol.exp: Test symbol destructor.
2012-10-14 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi2-cli.exp: Move to mi-cli.exp.

View File

@ -160,3 +160,4 @@ gdb_test "python print a\[0\].is_valid()" "True" "Test symbol validity"
delete_breakpoints
gdb_unload
gdb_test "python print a\[0\].is_valid()" "False" "Test symbol validity"
gdb_test_no_output "python a = None" "Test symbol destructor"