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

QStringList update elements during iteration circle: RuntimeError::unaligned memory acess

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 6.5.0
    • None
    • WebAssembly

    Description

      Problem code:

       

      QStringList m_userList;
      m_userList.append("AnyUser1");
      QStringList userList(m_userList);
      for (QString &user : userList)
      {
          user = user + " AnyName1";
      }
      userList.push_front("AnyUser0");

       

      Working code:

       

      QStringList m_userList;
      m_userList.append("AnyUser1");
      QStringList userList(m_userList);
      for (int i = 0; i < userList.size(); i++)
      {
          QString user = userList[i];
          user = user + " AnyName1";
          userList[i] = user;
      }
      userList.push_front("AnyUser0"); 

       

      Attachments

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

        Activity

          People

            piwierci Piotr Wierciński
            ivanov.ivan Ivan Ivanov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes