Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting ASSERT: "casted->type == SInt32Type" when bitwise ORing with 0 in Javascript
Forum Updated to NodeBB v4.3 + New Features

Getting ASSERT: "casted->type == SInt32Type" when bitwise ORing with 0 in Javascript

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 824 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    infinicat
    wrote on last edited by
    #1

    Using the new Qt 5.4. This issue did not happen in Qt 5.3.2.

    I have Javascript code that retrieves the integer part of a floating point by bitwise ORing with 0. I use QJSEngine to evaluate the code. When running a Debug build, I'm getting this assertion:
    "ASSERT: "casted->type == SInt32Type" in file compiler\qv4ssa.cpp, line 4065"

    Example code:
    @
    QJSEngine engine;
    QString jsCode = "var n = 0.1; var test = (n*255) | 0;";
    QJSValue result = engine.evaluate( jsCode );
    @

    I've noticed two things:

    1. This assertion only happens when there is a variable or function call involved. That is, the assertion does not happen if the operation is only with constants like: var test = (0.1 * 255) | 0;
    2. This assertion also only happens when ORing with 0. If I change code to OR with 1, assertion does not occur.

    Is this a bug?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      revflex
      wrote on last edited by
      #2

      I'm seeing this same issue also when using QtCanvas3D + latest three.js on Windows..

      1 Reply Last reply
      0
      • R Offline
        R Offline
        revflex
        wrote on last edited by
        #3

        Created bug for this: https://bugreports.qt-project.org/browse/QTBUG-43309

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved