# HG changeset patch # User Tom Rodriguez # Date 1435600171 25200 # Node ID 84d5125aa31a6185b031b26ccf28fd3a3f007e36 # Parent 9143e6b3c475ccc904db95067cbabb9bccffb41c# Parent 62dc08c8b68726436cc8789e0f41e6d32c214dff Merge diff -r 9143e6b3c475 -r 84d5125aa31a graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon Jun 29 10:22:15 2015 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon Jun 29 10:49:31 2015 -0700 @@ -26,7 +26,6 @@ import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.word.Word.*; -import static jdk.internal.jvmci.code.UnsignedMath.*; import java.lang.reflect.*; @@ -93,7 +92,7 @@ * Perform null and array bounds checks for arguments to a cipher operation. */ static void checkArgs(byte[] in, int inOffset, byte[] out, int outOffset) { - if (probability(VERY_SLOW_PATH_PROBABILITY, aboveThan(inOffset + AES_BLOCK_SIZE, in.length) || aboveThan(outOffset + AES_BLOCK_SIZE, out.length))) { + if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE < outOffset)) { DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } }