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

[Reg 5.15 -> 6.1.0] QVector print result after growth is invalid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.0.1, 6.1
    • 6.1.0
    • None
    • Windows 10, MSVC 16.8.4
    • Windows

    Description

      Release mode, 32-bit.

      Program:

      #include <QDebug>
      #include <QVector>
      
      int main(int, char **) {
        QVector<qint64> v;
        for (int i = 0; i < 7; ++i) {
          v.append(i);
          qDebug() << i << v.at(i);
        }
        qDebug() << v;
        return 0;
      }
      

      Expected result:

      0 0
      1 1
      2 2
      3 3
      4 4
      5 5
      6 6
      QList(0, 1, 2, 3, 4, 5, 6)

      Invalid results:

      0 0
      1 1
      2 2
      3 3
      4 4
      5 5
      6 6
      QList(0, 1, 2, 3, 4, -930837747982139387, 6)
      
      ...
      QList(0, 1, 2, 3, 4, 61361544922923013, 6)
      
      ...
      QList(0, 1, 2, 3, 4, 79657418409115653, 6)
      

      Attachments

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

        Activity

          People

            agolubev Andrei Golubev
            nodir.temir Nodir Temirkhodjaev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes