Patchwork [gccgo] Crash after RTEMS failure

login
register
mail settings
Submitter Ian Taylor
Date July 12, 2010, 8:22 a.m.
Message ID <mcrmxtxt8hd.fsf@google.com>
Download mbox | patch
Permalink /patch/58579/
State New
Headers show

Comments

Ian Taylor - July 12, 2010, 8:22 a.m.
This patch from Vinu Rajashekhar makes sure that a Go program crashes if
it fails to add a task variable on RTEMS.  Committed to gccgo branch.

Ian

Patch

Index: libgo/runtime/rtems-task-variable-add.c
===================================================================
--- libgo/runtime/rtems-task-variable-add.c	(revision 161752)
+++ libgo/runtime/rtems-task-variable-add.c	(working copy)
@@ -4,6 +4,8 @@ 
    Use of this source code is governed by a BSD-style
    license that can be found in the LICENSE file.  */
 
+#include <assert.h>
+
 #include <rtems/error.h>
 #include <rtems/system.h>
 #include <rtems/rtems/tasks.h>
@@ -16,6 +18,7 @@  __wrap_rtems_task_variable_add (void **v
   if (sc != RTEMS_SUCCESSFUL)
     {
       rtems_error (sc, "rtems_task_variable_add failed");
+      assert (0);
     }
 }