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

is_oop_or_null involves undefined behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 9
    • 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.

            coleenp Coleen Phillimore
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: