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

multiple assignment statements (see #754) still a problem in 0.555 ? #770

Closed
SteveDE opened this issue Dec 2, 2022 · 4 comments
Closed
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@SteveDE
Copy link

SteveDE commented Dec 2, 2022

Merged to 0.555 and I'm afraid it is still not ordering correctly re: #754

Pulled down 0.555 luau windows binary and ran with luau --compile BinarySearch.lua > Result.text

   30:                 tfound[1],num = num,num - 1
SUBK R11 R10 K4
SETTABLEN R10 R9 1

If the assignments are not done using multiple assignment the order is correct and the search works

   39:                 tfound[1] = num
39: SETTABLEN R10 R9 1
   40:                 num = num - 1
40: SUBK R10 R10 K13

BinarySearch.zip

@SteveDE SteveDE added the bug Something isn't working label Dec 2, 2022
@SteveDE
Copy link
Author

SteveDE commented Dec 2, 2022

Digging more, I see an added move, but my test harness died in the same spot.

   30:                 tfound[1],num = num,num - 1
SUBK R11 R10 K4
SETTABLEN R10 R9 1
MOVE R10 R11

vs sep line assign

   30:                 tfound[1] = num
SETTABLEN R10 R9 1
   31:                 num = num - 1
SUBK R10 R10 K4

@vegorov-rbx
Copy link
Collaborator

Ordering is correct in both cases, in first case SUBK writes result into R11 that doesn't conflict with R10.
Execution result of your sample is the same in both versions.

Meta-method execution order inside multiple assignment statement is not guaranteed.

@vegorov-rbx vegorov-rbx added the invalid This doesn't seem right label Dec 2, 2022
@SteveDE
Copy link
Author

SteveDE commented Dec 2, 2022

Bitten by LUAU_FASTFLAGVARIABLE(LuauMultiAssignmentConflictFix, false)
Stock compile as library needs this flag changed or set at runtime

@vegorov-rbx
Copy link
Collaborator

Yeah, unfortunately we don't have the flag system described in the documentation right now.
It's something we have to improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Development

No branches or pull requests

2 participants