Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8027882 | 8 | Rickard Backman | P2 | Closed | Fixed | b115 |
When running some javascript through nashorn this assert was detected.
Small java repro:
public class Nested {
public static int value = 17;
public static void main(String[] args) throws Exception {
for (int i = 0; i < 100; ++i) {
int result = runTest();
System.out.println(result);
}
}
public static int runTest() {
int sum = 0;
for (int j = 0; j < 100000; j = java.lang.Math.addExact(j, 1)) {
sum = 1;
for (int i = 0; i < 5; ++i) {
sum = sum * value; //* value;
}
}
return sum;
}
}
Small java repro:
public class Nested {
public static int value = 17;
public static void main(String[] args) throws Exception {
for (int i = 0; i < 100; ++i) {
int result = runTest();
System.out.println(result);
}
}
public static int runTest() {
int sum = 0;
for (int j = 0; j < 100000; j = java.lang.Math.addExact(j, 1)) {
sum = 1;
for (int i = 0; i < 5; ++i) {
sum = sum * value; //* value;
}
}
return sum;
}
}
- backported by
-
JDK-8027882 mathExact: assert(i < _max) failed: oob: i=1, _max=1
-
- Closed
-