Browse Source

Fix Fork stack growth bug

gdouglas 13 years ago
parent
commit
e2557038e7
2 changed files with 4 additions and 2 deletions
  1. 3 1
      gmsrc/doc/ChangeLog.txt
  2. 1 1
      gmsrc/src/gm/gmThread.cpp

+ 3 - 1
gmsrc/doc/ChangeLog.txt

@@ -401,4 +401,6 @@ o Improved syntactical sugar for functions. Thanks HenryTran.
 10/02/12
 o Added experimental project gmddotnet (gmDebuggerNet) which is gmd ported to C# .Net from C++ MFC.
   This was simply an experiment, this example debugger is as identically terrible as the original version.
-  
+  
+12/05/12
+o Fixed Fork stack growth bug. Thanks funkbot.

+ 1 - 1
gmsrc/src/gm/gmThread.cpp

@@ -718,7 +718,7 @@ gmThread::State gmThread::Sys_Execute(gmVariable * a_return)
         GM_ASSERT( newthr );
 
         // make sure there is enough room
-        newthr->Touch( m_size - m_base + 2 );
+        newthr->Touch( m_size - m_base + 2 - GMTHREAD_SLACKSPACE);
         // copy stack and vars
         memcpy( newthr->m_stack, &m_stack[ m_base - 2 ], sizeof( gmVariable ) * (m_top - m_base + 2 ) );