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

Undefined behaviours in globalDefinitions.hpp

XMLWordPrintable

      FloatIntConv and DoubleLongConv usage lead to undefined behaviours due to type aliasing violations. The conformed way is to implement a bit cast using memcpy.

      jlong_accessor usage leads to undefined behaviours due to reading from inactive members of unions. While type punning is legal in C, it is not in C++, and may break in the future. Using a struct combined with memcpy would be sufficient here.

            dfenacci Damon Fenacci
            qamai Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: