2011-03-01 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 20:24:48 +0000 (20:24 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 20:24:48 +0000 (20:24 +0000)
* reverse.c (record_restore): Move null-check to before pointer
dereference.

gdb/ChangeLog
gdb/record.c

index 81957f4ce85ce2137815d69a49462c74333de596..e380be2826f47bb1b98d6c0f8b2226e6309a53c3 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-01  Michael Snyder  <msnyder@vmware.com>
 
+       * reverse.c (record_restore): Move null-check to before pointer
+       dereference.
+
        * python/py-utils.c (gdbpy_obj_to_string): Delete unused variable.
 
        * objc-lang.c (selectors_info): Add explanitory comment.
index 784f5fadf82d3854ee317692f470d8c82ce89cdf..35673826f2e3e3ec7a3c788f287c720d757a422f 100644 (file)
@@ -2214,12 +2214,12 @@ record_restore (void)
 
   /* Now need to find our special note section.  */
   osec = bfd_get_section_by_name (core_bfd, "null0");
+  if (osec == NULL)
+    return;
   osec_size = bfd_section_size (core_bfd, osec);
   if (record_debug)
     fprintf_unfiltered (gdb_stdlog, "Find precord section %s.\n",
                        osec ? "succeeded" : "failed");
-  if (osec == NULL)
-    return;
   if (record_debug)
     fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (core_bfd, osec));