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

Crash when evaluating an invalid QQmlExpression.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 5.3.0
    • None
    • I guess it doesn't matter, but I'm on Windows 7.
    • 7fa4b8600be74c10c555ba07317e9b754f18ce3d (qtdeclarative)

    Description

      For example, trying to call QQmlExpression::evaluate with an expression such as abc=123 crashes, with no chance to catch an exception or check for an error code.
      The following C++ code reproduces the bug:

      #include <QtQml/QQmlExpression>
      #include <QtQml/QQmlEngine>
      #include <QtCore/QCoreApplication>
      int main(int nargs, char **args)
      {
       QCoreApplication app(nargs,args);
       // I know the following line is terrible, but it was just for keeping this short.
       QQmlExpression((new QQmlEngine())->rootContext(),new QObject(),"abc=123").evaluate(new bool());
      }
      

      Attachments

        1. BogueQtQQmlExpression.jpg
          140 kB
          Dominic Genest
        2. BogueQtQQmlExpressionCallStack.jpg
          44 kB
          Dominic Genest
        3. qtbug41860_stack.txt
          10 kB
          Friedemann Kleint
        4. qtbug41860.zip
          1 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              domgenest Dominic Genest
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes