Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-52472

Undefined Behaviour in qsimpledrag.cpp line 207

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.2.4, 6.3.0 Beta3
    • 5.5.0
    • GUI: Drag and Drop
    • None
    • Source code inspection
    • 29a7489769bca59630782061789561fb07d77892 c5792dcfd6 (qt/tqtc-qtbase/dev) 32b278b13b (qt/qtbase/6.2.4) 32b278b13b (qt/tqtc-qtbase/6.2.4)

    Description

      I have an scientific application and enabled floating point exceptions. This results in drag&drop operations (at least in my treeview) always giving a floating point invalid-operation exception in line 207 of qtbase/src/gui/kernel/qsimpledrag.cpp. The offending line is:

        if (pos.x() == int(qInf())) { ... } 
      

      that is a conversion of floating point +INFINITY to int, which is I believe is Undefined Behaviour.

      (grepping out of curiousity shows that the same dubious construct is also used in ./qtquickcontrols/src/controls/qquickmenu.cpp, line 405)

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              jablo Jacob Lorensen
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: