Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT bytecode optimizer fails on table init #347

Open
Mynogs opened this issue Apr 23, 2020 · 0 comments
Open

JIT bytecode optimizer fails on table init #347

Mynogs opened this issue Apr 23, 2020 · 0 comments

Comments

@Mynogs
Copy link
Contributor

Mynogs commented Apr 23, 2020

On table init parameter values mixed up. This is the Lua code:

function border(e, x, y, h, rgb, buttons)
  local dl = {
    e.COLOR_RGB(rgb[1], rgb[2], rgb[3]),
    e.BEGIN(e.RECTS),
    e.LINE_WIDTH(480),
    e.VERTEX2II(x + 30, y + 30),
    e.VERTEX2II(511, h - 30),
    e.END(),
    VERTEX2II = function(x, y, handle, cell) -- FT800
      print('---->', x, y, handle, cell)
      return (2 << 30) | (x << 21) | (y << 12) | ((handle or 0) << 7) | (cell or 0)
    end,

The call:
block.border1 = border(e, 0, 0, 272, {50, 102, 204}, {'Main', 'Calibrate', 'Log'})

Without optimizer the output is:
----> 30 30 nil nil
----> 511 242 nil nil

With optimizer:
----> 30 30 nil nil
----> 30 242 nil nil

The second parameter of the first line is inserted as the first parameter of the second (I found out through value variations). The 511 is ignored. When I comment out the first line, the value is a large, meaningless number.

Greetings
André

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant