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

QStringBuilder does not necessarily preserve nullness

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes