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

Fix -Wconversion warnings in verifier code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 22
    • hotspot
    • b09

      In my warnings count:

      55 /src/hotspot/share/classfile/verifier.cpp
      29 /src/hotspot/share/classfile/stackMapFrame.cpp
      18 /src/hotspot/share/classfile/stackMapTableFormat.hpp
      15 /src/hotspot/share/classfile/stackMapFrame.hpp
      10 /src/hotspot/share/classfile/stackMapTable.cpp

      The verifiers functions take u2 for bci and index but then use these as int to print out any verification errors or keep in the stack allocated container types for error reporting. It also has a comment to use int32_t for various counts on purpose, so passing u2 to these counts doesn't make sense.

        // Logically, the _frame_count (as well as many fields in the StackFrame)
        // should be a u2, but if we defined the variable as that type it will
        // be difficult to detect/recover from overflow or underflow conditions.
        // Widening the type and making it signed will help detect these.
        int32_t _code_length;
        int32_t _frame_count; // Stackmap frame count

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: