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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • hs25
    • Affects Version/s: hs25
    • Component/s: 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;
            }
        }

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

                Created:
                Updated:
                Resolved: