Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-8532

Creator hangs in code completion

    XMLWordPrintable

Details

    • 6ce9a80afa43b3a40b0244ebef3b41ba03cc76a0

    Description

      My code looks like this:

         QString pattern;
         int index = pattern.lastIndexOf('/');
         if (index == pattern.co
      

      Here I want to do code completion. The combo box opens up, I select "count" and press Return. Afterwards, Creator hangs. The reason is that the while loop at src/plugins/cpptools/cppcompletionassist.cpp:347 starts out with a negative controlling value. In my example, the values are as follows:
      toInsert.length() = 5, editor->position() = 21147, basePosition = 21140, resulting in an initial value of -2 for preserveLength. Relevent stack trace attached.

      Attachments

        Activity

          People

            erikv Erik Verbruggen
            kandeler Christian Kandeler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: