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

Divergent runtime behaviour of QJSPrimitiveValue when it is aot-compiled and when interpreted

    XMLWordPrintable

Details

    • e070b5aa3 (dev), b0a681e08 (6.5)

    Description

      For the following test case: 

       

      struct WrapWithVariant
      {
          Q_GADGET
          QML_VALUE_TYPE(wrappedWithVariant)
          QML_CONSTRUCTIBLE_VALUE    Q_PROPERTY(QVariant intPrimitiveValue READ intPrimitiveValue CONSTANT)
          Q_PROPERTY(QVariant undefinedPrimitiveValue READ undefinedPrimitiveValue CONSTANT)
          Q_PROPERTY(QVariant nullPrimitiveValue READ nullPrimitiveValue CONSTANT)
      public:
          WrapWithVariant() = default;    QVariant intPrimitiveValue() const
          {
              return QVariant::fromValue<QJSPrimitiveValue>(QJSPrimitiveValue(12));
          }    QVariant undefinedPrimitiveValue() const
          {
              return QVariant::fromValue<QJSPrimitiveValue>(QJSPrimitiveValue(QJSPrimitiveUndefined()));
          }    QVariant nullPrimitiveValue() const
          {
              return QVariant::fromValue<QJSPrimitiveValue>(QJSPrimitiveValue(QJSPrimitiveNull()));
          }
       
      
      
      // qml file
      QtObject { 
          property wrappedWithVariant wrapped
          property bool primitiveIsNull: wrapped.nullPrimitiveValue === null
      }

       

      Running these with aot-compiled and interpreted gives divergent result.

      Remind yourself to re-add https://codereview.qt-project.org/c/qt/qtdeclarative/+/448219/17..18 test after fixing this.

       

       

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            semih.yavuz Semih Yavuz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes