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

[REG 5.6.0->5.6.1] lastIndexOf on a string always returns -1 in Release build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.3
    • 5.6.1, 5.6.2, 5.7.0
    • Qt Script
    • None
    • QtCreator 4.0.2 using the VisualStudio 2015 compiler, Windows 10

    Description

      When using the 'lastIndexOf' method of a string in JavaScript, it always returns -1. It only affects release builds. This bug appeard with 5.6.1, 5.6.0 was still ok.

      Steps to reproduce:

      In 'helloscript' sample, replace the content of the file 'helloscript.js' with:

      helloscript.js
      //! [0]
      button.text = "'abcabc'.lastIndexOf('c'): " + 'abcabc'.lastIndexOf('c');
      button.styleSheet = 'font-style: italic';
      button.show();
      //! [0]
      

      The debug build correctly outputs:

      'abcabc'.lastIndexOf('c'): 5

      The release build outputs:

      'abcabc'.lastIndexOf('c'): -1

      Attachments

        Issue Links

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

          Activity

            People

              laknoll Lars Knoll
              jcm Jean-Claude Monnin
              Votes:
              5 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes