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

QStringBuilder does not necessarily preserve nullness

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7
    • 6.6
    • None
    • 6b8106383228785bf7a184d01f8c9692dd91e6c0

      Another variation of QTBUG-114238:

      QString s; 
      QVERIFY(s.isNull());
      
      QString r1 = s % s;
      QVERIFY(r1.isNull());
      QString r2 = s % s % s;
      QVERIFY(r2.isNull()); // FAIL
      

      r1 is null because of the special case of QStringBuilder between QStrings. But r2 isn't null, because QStringBuilder builds a 0-length uninitialized string (using QString result(0, Qt::Uninitialized), and that constructor never creates null strings.

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

            thiago Thiago Macieira
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes