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

Crash when evaluating an invalid QQmlExpression.

XMLWordPrintable

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

      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());
      }
      

        1. BogueQtQQmlExpression.jpg
          BogueQtQQmlExpression.jpg
          140 kB
        2. BogueQtQQmlExpressionCallStack.jpg
          BogueQtQQmlExpressionCallStack.jpg
          44 kB
        3. qtbug41860_stack.txt
          10 kB
        4. qtbug41860.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes