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

Undefined behaviours in globalDefinitions.hpp

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: