help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [PATCH 1/2] fix GC bug in compile_block, reported by Gw


From: Paolo Bonzini
Subject: [Help-smalltalk] [PATCH 1/2] fix GC bug in compile_block, reported by Gwen
Date: Tue, 16 Jul 2013 16:37:52 +0200

libgst:
2013-07-16  Paolo Bonzini  <address@hidden>

        * libgst/comp.c: Do not call add_literal within an incubator context.
---
 libgst/ChangeLog |  4 ++++
 libgst/comp.c    | 16 +++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index f5a77d7..197b81e 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-16  Paolo Bonzini  <address@hidden>
+
+       * libgst/comp.c: Do not call add_literal within an incubator context.
+
 2013-06-14  Gwenael Casaccio <address@hidden>
 
        * libgst/dict.c: Remove useless code: gst_ordered_collection structure.
diff --git a/libgst/comp.c b/libgst/comp.c
index 10330e1..1a59f2f 100644
--- a/libgst/comp.c
+++ b/libgst/comp.c
@@ -1064,7 +1064,7 @@ compile_block (tree_node blockExpr)
   bc_vector current_bytecodes, blockByteCodes;
   int argCount, tempCount;
   int stack_depth;
-  OOP blockClosureOOP, blockOOP;
+  OOP litOOP, blockOOP;
   gst_compiled_block block;
   inc_ptr incPtr;
 
@@ -1114,17 +1114,15 @@ compile_block (tree_node blockExpr)
   INCR_STACK_DEPTH ();
   block = (gst_compiled_block) OOP_TO_OBJ (blockOOP);
   if (block->header.clean == 0)
-    {
-      blockClosureOOP = make_clean_block_closure (blockOOP);
-      _gst_compile_byte (PUSH_LIT_CONSTANT, add_literal (blockClosureOOP));
-    }
+    litOOP = make_clean_block_closure (blockOOP);
   else
-    {
-      _gst_compile_byte (PUSH_LIT_CONSTANT, add_literal (blockOOP));
-      _gst_compile_byte (MAKE_DIRTY_BLOCK, 0);
-    }
+    litOOP = blockOOP;
 
   INC_RESTORE_POINTER (incPtr);
+
+  _gst_compile_byte (PUSH_LIT_CONSTANT, add_literal (litOOP));
+  if (block->header.clean != 0)
+    _gst_compile_byte (MAKE_DIRTY_BLOCK, 0);
 }
 
 
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]