Skip to content

Commit 157da25

Browse files
committed
Fix testcase: second transition to native is allowed and should be ignored.
1 parent 6ad02e6 commit 157da25

File tree

1 file changed

+5
-5
lines changed
  • truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/interop

1 file changed

+5
-5
lines changed

truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/interop/NativeVector.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ private static Unsafe getUnsafe() {
7676

7777
@TruffleBoundary
7878
public void transitionToNative() {
79-
assert !isPointer() : "is already transitioned";
79+
if (!isPointer()) {
80+
nativeStorage = unsafe.allocateMemory(vector.length * Double.BYTES);
8081

81-
nativeStorage = unsafe.allocateMemory(vector.length * Double.BYTES);
82-
83-
for (int i = 0; i < vector.length; i++) {
84-
set(i, vector[i]);
82+
for (int i = 0; i < vector.length; i++) {
83+
set(i, vector[i]);
84+
}
8585
}
8686
}
8787

0 commit comments

Comments
 (0)