Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17632

Undefined behavior in reformatCharacter(int , int, bool)

    XMLWordPrintable

Details

    Description

      In the function

      static QString reformatCharacter(int code, int size, bool isSigned)
      

      there's the line:

      out += QString("/%1    ").arg((1 << (8*size)) + code).left(2 + 2 * size);
      

      size can be 4.

      According to cppcheck "Shifting 32-bit value by 32 bits is undefined behaviour"

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes