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] dwarf2loc, guard against null


get_frame_function can return null; in this case, crash...

OK to apply?

2007-09-17  Jerome Guitton  <guitton@adacore.com>

	* dwarf2loc.c (dwarf_expr_frame_base): Guard against NULL.



Index: dwarf2loc.c
===================================================================
--- dwarf2loc.c	(revision 14570)
+++ dwarf2loc.c	(working copy)
@@ -151,6 +151,9 @@ dwarf_expr_frame_base (void *baton, gdb_
 
   framefunc = get_frame_function (debaton->frame);
 
+  if (!framefunc)
+    error (_("No frame function."));
+
   if (SYMBOL_OPS (framefunc) == &dwarf2_loclist_funcs)
     {
       struct dwarf2_loclist_baton *symbaton;

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