summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-07 06:11:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-07 06:11:34 +0000
commit5093c0496e4ddbb86d5a190163f54b21a4b60e39 (patch)
tree9868ae41923a8d6dfaafdc26b95f1f42a7bee150
parentc67251edb478509b4abd9910e0b499a116112a3c (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--gc.c3
-rw-r--r--ruby.h3
3 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3abdf22..3209b11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
Mon Aug 7 13:59:12 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ruby.h (CLONESETUP): should copy flags before any potential
+ object allocation.
+
* regex.c (re_match): check for stack depth was needed.
Sat Aug 5 16:43:43 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
diff --git a/gc.c b/gc.c
index fb549f7..753d584 100644
--- a/gc.c
+++ b/gc.c
@@ -280,6 +280,7 @@ rb_newobj()
if (!freelist) rb_gc();
+ if (freelist->as.free.next && freelist->as.free.next->as.free.flag != 0) abort();
obj = (VALUE)freelist;
freelist = freelist->as.free.next;
return obj;
@@ -665,7 +666,7 @@ gc_sweep()
if (p->as.basic.flags) {
obj_free((VALUE)p);
}
- if (need_call_final && FL_TEST(p, FL_FINALIZE)) {
+ if (need_call_final && FL_TEST(p, FL_FINALIZE)) {
p->as.free.flag = FL_MARK; /* remain marked */
p->as.free.next = final_list;
final_list = p;
diff --git a/ruby.h b/ruby.h
index 9dd5f05..11c429f 100644
--- a/ruby.h
+++ b/ruby.h
@@ -222,7 +222,8 @@ VALUE rb_newobj _((void));
if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT);\
}
#define CLONESETUP(clone,obj) do {\
- OBJSETUP(clone,rb_singleton_class_clone(RBASIC(obj)->klass),RBASIC(obj)->flags);\
+ RBASIC(clone)->flags = (RBASIC(obj)->flags);\
+ RBASIC(obj)->klass = (rb_singleton_class_clone(RBASIC(obj)->klass));\
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
if (FL_TEST(obj, FL_EXIVAR)) rb_clone_generic_ivar((VALUE)clone,(VALUE)obj);\
} while (0)