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

BytecodeBuilder.cpp: fix invalid assumption that int32_t aliases int #1347

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

ds-sloth
Copy link
Contributor

I found that Luau failed to build on the devkitPro toolchain for 3DS.

This target uses an ILP32 model, and int32_t is an alias of long. BytecodeBuilder.cpp includes a line where an int is passed by reference to a function expecting an int32_t.

This PR fixes that line. It'd be nice to get the fix upstream. Thanks for your consideration!

As a sidenote, I also found an issue in the toolchain affecting Parser.cpp, where limits.h did not include ULLONG_MAX. That's probably a toolchain issue, but including climits rather than limits.h fixes it. It's possible that the C++ standard and C standard were out of sync in the toolchain, because limits.h defines ULLONG_MAX for C99 and above. climits is guaranteed to define it for C++11 and above. If you're open to switching the include to climits, that'd be convenient for us, but this is a small patch and not a big deal for us to maintain downstream.

@vegorov-rbx
Copy link
Collaborator

Thanks for the fix.

As for ULLONG_MAX, that does look like a toolchain issue.
We do not use C++ header wrappers for C headers.
We might find a different replacement for the constant if it has such a problem.

@vegorov-rbx vegorov-rbx merged commit 58f8c24 into luau-lang:master Jul 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants