Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8027444

mathExact: assert(i < _max) failed: oob: i=1, _max=1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • hs25
    • hs25
    • hotspot
    • None
    • b57
    • x86, x86_64
    • Not verified

        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;
            }
        }

              rbackman Rickard Backman (Inactive)
              rbackman Rickard Backman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: