Skip to content

Commit 180686e

Browse files
committed
Ensure the class of an object is shared if the object is shared
1 parent 7c411d9 commit 180686e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/truffleruby/language/RubyDynamicObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import com.oracle.truffle.api.profiles.BranchProfile;
5353
import com.oracle.truffle.api.profiles.ConditionProfile;
5454
import com.oracle.truffle.api.utilities.TriState;
55+
import org.truffleruby.language.objects.shared.SharedObjects;
5556

5657
/** All Ruby DynamicObjects extend this. */
5758
@ExportLibrary(RubyLibrary.class)
@@ -76,6 +77,7 @@ public final RubyClass getMetaClass() {
7677
}
7778

7879
public void setMetaClass(RubyClass metaClass) {
80+
SharedObjects.assertPropagateSharing(this, metaClass);
7981
this.metaClass = metaClass;
8082
}
8183

0 commit comments

Comments
 (0)