Skip to content

Commit 1701064

Browse files
committed
Add an assertion for sharing when setting array store and size.
1 parent 3c4b5c9 commit 1701064

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/truffleruby/core/array/ArrayHelpers.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
import org.truffleruby.RubyContext;
1313
import org.truffleruby.RubyLanguage;
1414
import org.truffleruby.core.array.library.ArrayStoreLibrary;
15+
import org.truffleruby.core.array.library.SharedArrayStorage;
1516

1617
public abstract class ArrayHelpers {
1718

1819
public static void setStoreAndSize(RubyArray array, Object store, int size) {
20+
assert (store instanceof SharedArrayStorage) == (array.getShape().isShared());
1921
array.store = store;
2022
setSize(array, size);
2123
}

0 commit comments

Comments
 (0)