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

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical 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

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes