This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos 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]

Fix wrong assert in cyg_thread_get_next


This patch fixes a wrong assert condition as reported by Daniel
Lidsten. Its correct to pass a NULL pointer as *current to
cyg_thread_get_next. Thats how you start the walk of the linked list.

        Andrew

Index: kernel/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.101
diff -u -r1.101 ChangeLog
--- kernel/current//ChangeLog   6 May 2003 16:10:14 -0000       1.101
+++ kernel/current//ChangeLog   20 May 2003 08:52:14 -0000
@@ -1,3 +1,9 @@
+2003-05-20  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+       * src/common/kapi.cxx (cyg_thread_get_next): Passing a *current
+       pointer as NULL if how you start the walk of the linked list. So
+       don't assert on NULL. Reported by Daniel Lidsten.
+
 2003-05-05  Gary Thomas  <gary@mlbassoc.com>
 
        * tests/tm_basic.cxx: Support new option controlling number of times
Index: kernel/current//src/common/kapi.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/src/common/kapi.cxx,v
retrieving revision 1.21
diff -u -r1.21 kapi.cxx
--- kernel/current//src/common/kapi.cxx 28 Jan 2003 05:07:01 -0000      1.21
+++ kernel/current//src/common/kapi.cxx 20 May 2003 08:52:14 -0000
@@ -331,7 +331,7 @@
     Cyg_Scheduler::lock();
 
     Cyg_Thread *thread = (Cyg_Thread *)*current;
-    CYG_ASSERT_CLASSC( thread );
+    CYG_ASSERT_ZERO_OR_CLASSC( thread );
     if( *current == 0 )
     {
         thread = Cyg_Thread::get_list_head();


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