gdbserver: Move pointer dereference to after assert checks.
authorHenrik Wallin <henrik.wallin@windriver.com>
Wed, 14 Oct 2015 11:14:26 +0000 (13:14 +0200)
committerAntoine Tremblay <antoine.tremblay@ericsson.com>
Thu, 29 Oct 2015 18:28:48 +0000 (14:28 -0400)
gdb/gdbserver/ChangeLog:

* linux-arm-low.c (arm_new_thread): Move pointer dereference
to after assert checks.

Signed-off-by: Henrik Wallin <henrik.wallin@windriver.com>
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-arm-low.c

index 70d832fa714169a3fc490704b6dd0bff88162c79..52d6b50342394b399c826209158297e0aa34cb83 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
+
+       * linux-arm-low.c (arm_new_thread): Move pointer dereference
+       to after assert checks.
+
 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
 
        * proc-service.c (ps_pdread): Add/adjust casts.
index bab2aafc751afd347f2d3908ef945236a63d9171..e10955f5c23094653660b98473cd5084413ca554 100644 (file)
@@ -706,8 +706,8 @@ arm_new_thread (struct lwp_info *lwp)
 static void
 arm_new_fork (struct process_info *parent, struct process_info *child)
 {
-  struct arch_process_info *parent_proc_info = parent->priv->arch_private;
-  struct arch_process_info *child_proc_info = child->priv->arch_private;
+  struct arch_process_info *parent_proc_info;
+  struct arch_process_info *child_proc_info;
   struct lwp_info *child_lwp;
   struct arch_lwp_info *child_lwp_info;
   int i;
@@ -718,6 +718,9 @@ arm_new_fork (struct process_info *parent, struct process_info *child)
   gdb_assert (child->priv != NULL
              && child->priv->arch_private != NULL);
 
+  parent_proc_info = parent->priv->arch_private;
+  child_proc_info = child->priv->arch_private;
+
   /* Linux kernel before 2.6.33 commit
      72f674d203cd230426437cdcf7dd6f681dad8b0d
      will inherit hardware debug registers from parent