aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--vm.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 01be941bba..8dd6907ed4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Dec 18 18:52:37 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm.c (vm_define_method): improve guard of iseq from GC. Fix
+ failure or segmentation fault in test_singleton_method(TestGc)
+ on sparc Solaris10 compiled with Oracle Solaris Studio 12.2.
+ [Bug #5762] [ruby-dev:45000] [Bug #4178]
+
Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
diff --git a/vm.c b/vm.c
index e04a44b696..67ca4393a5 100644
--- a/vm.c
+++ b/vm.c
@@ -1912,8 +1912,7 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval,
GetISeqPtr(iseqval, miseq);
if (miseq->klass) {
- iseqval = rb_iseq_clone(iseqval, 0);
- RB_GC_GUARD(iseqval);
+ RB_GC_GUARD(iseqval) = rb_iseq_clone(iseqval, 0);
GetISeqPtr(iseqval, miseq);
}