This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[RFA] mdebugread.c (psymtab_to_symtab_1): assert that 'fh' is not null


This occurs along a path where fh *could* be null, and then we dereference it.

OK?

2011-03-04  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>

	* mdebugread.c (psymtab_to_symtab_1): Assert fh is not null.

Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.120
diff -u -p -r1.120 mdebugread.c
--- mdebugread.c	2 Mar 2011 23:54:16 -0000	1.120
+++ mdebugread.c	4 Mar 2011 22:10:46 -0000
@@ -4323,6 +4323,7 @@ psymtab_to_symtab_1 (struct partial_symt
       top_stack->blocktype = stFile;
 
       ext_ptr = PST_PRIVATE (pst)->extern_tab;
+      gdb_assert (fh);
       for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
 	parse_external (ext_ptr, fh->fBigendian,
 			pst->section_offsets, pst->objfile);

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