diff --git a/transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java b/transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java index e6052fdb15..bff79a49cb 100644 --- a/transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java +++ b/transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java @@ -23,6 +23,7 @@ import io.netty.channel.unix.IovArray; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; public abstract class IovArrayTest { @@ -40,6 +41,7 @@ public abstract class IovArrayTest { assertEquals(16, array.size()); assertTrue(buf.release()); assertTrue(buf2.release()); + assertNotEquals(-1, array.memoryAddress(0)); array.release(); assertEquals(0, buffer.refCnt()); } diff --git a/transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java b/transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java index 6cf16ac0fc..6071cccc9f 100644 --- a/transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java +++ b/transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java @@ -212,7 +212,7 @@ public final class IovArray implements MessageProcessor { * Returns the {@code memoryAddress} for the given {@code offset}. */ public long memoryAddress(int offset) { - return memory.memoryAddress() + idx(offset); + return memoryAddress + idx(offset); } /**