From e8eb84c7541dda0de1c0cf0fdfff9be86e5ba1ed Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 17 Sep 2009 23:38:24 +0200 Subject: [PATCH] Avoid the access to NULL memory while gc marks. --- src/thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/thread.c b/src/thread.c index ad43c809d3b..ecc44f3f5f9 100644 --- a/src/thread.c +++ b/src/thread.c @@ -45,7 +45,8 @@ mark_one_thread (struct thread_state *thread) } #endif - mark_byte_stack (thread->m_byte_stack_list); + if (thread->m_byte_stack_list) + mark_byte_stack (thread->m_byte_stack_list); mark_catchlist (thread->m_catchlist); @@ -91,7 +92,8 @@ unmark_threads (void) struct thread_state *iter; for (iter = all_threads; iter; iter = iter->next_thread) - unmark_byte_stack (iter->m_byte_stack_list); + if (iter->m_byte_stack_list) + unmark_byte_stack (iter->m_byte_stack_list); } static void -- 2.11.4.GIT