is_oop_or_null involves undefined behavior

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 10
    • Affects Version/s: 9
    • Component/s: hotspot
    • None
    • b22
    • generic
    • generic

      oopDesc::is_oop_or_null is an ordinary member function, whose definition includes a test using the expression "this == NULL". However, this can be assumed to never be NULL, as that would require undefined behavior. So the compiler is free to optimize away that test, eliminating the "_or_null" part of the function's intended semantics. Recent versions of gcc (like gcc 6) seem to be more aggressive about optimizations around that sort of thing, leading to crashes.

            Assignee:
            Coleen Phillimore
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: