Initialize SIM_DESC properly.
authorAnthony Green <green@redhat.com>
Wed, 13 Jan 2010 08:28:26 +0000 (08:28 +0000)
committerAnthony Green <green@redhat.com>
Wed, 13 Jan 2010 08:28:26 +0000 (08:28 +0000)
sim/moxie/ChangeLog
sim/moxie/interp.c

index c553855239f7697e704f8c9cf71d6f94b0400cbb..7a3c0fa0858783118e3d89f803c96006762de374 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-13  Anthony Green  <green@moxielogic.com>
+
+       * interp.c (sim_open): Initialize the SIM_DESC object properly
+       with sim_config() and sim_post_argv_init().
+
 2010-01-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure: Regenerate.
index 8b8879f13b3e5555f6eba961200a7f83f77f29d7..8d280f2cc47c2d898c68b230584f1ce069f05be2 100644 (file)
@@ -1176,6 +1176,22 @@ sim_open (kind, cb, abfd, argv)
   
   set_initial_gprs (); /* Reset the GPR registers.  */
   
+  /* Configure/verify the target byte order and other runtime
+     configuration options */
+  if (sim_config (sd) != SIM_RC_OK)
+    {
+      sim_module_uninstall (sd);
+      return 0;
+    }
+
+  if (sim_post_argv_init (sd) != SIM_RC_OK)
+    {
+      /* Uninstall the modules to avoid memory leaks,
+        file descriptor leaks, etc.  */
+      sim_module_uninstall (sd);
+      return 0;
+    }
+
   return sd;
 }
 
This page took 0.02407 seconds and 4 git commands to generate.