From bd95ccdbd6ab106c06e08553333d4b2ab2903c5f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 27 Sep 2007 16:10:29 -0600 Subject: [PATCH] clear object header flags after copying array in Object.clone() --- src/builtin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/builtin.cpp b/src/builtin.cpp index 44209e5f4c..588b006c00 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -108,6 +108,8 @@ Java_java_lang_Object_clone(Thread* t, jclass, jobject o) if (classArrayElementSize(t, class_)) { clone = static_cast(allocate(t, size)); memcpy(clone, *o, size); + // clear any object header flags: + cast(*o, 0) = objectClass(t, *o); } else { clone = make(t, objectClass(t, *o)); memcpy(reinterpret_cast(clone) + 1,