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

Fix crash with the index type function, where it would stack overflow due to not waiting for a pending-expansion #1407

Merged

Conversation

karl-police
Copy link
Contributor

@karl-police karl-police commented Sep 13, 2024

Fix for #1406

While it is good to let index wait for the pending-expansion. To re-produce the issue you need more than just this code: https://i.imgur.com/b3OmUGF.png

It needs this, else it won't crash.

local function ProblemCauser(key: Keys, value)
    PlayerData[key] = value
end

 

But regarding "pending things", I'd recommend generalized functions for sanity checks like these, since there will be more cases of similar issues I believe. But I am 100% sure that eventually this issue here can maybe be prevented if looking at the Constraints. (And optimization) Not sure if index needs the table fully completed, or if it is preferred that the info is available based on how much info is available at the current position in the code.

But if this gets done, I hope that they'll be connected to the Solver Logger, because I actually refined mine with colors and more info (yet need to finish that) to understand the Luau Source Code more and to debug issues.

@karl-police
Copy link
Contributor Author

karl-police commented Sep 13, 2024

A Unit Test is going to appear soon!

I need to cope with the /out folder, hence why I really need this PR here -> #1394

🙏

@karl-police
Copy link
Contributor Author

Unit Test is there now

Comment on lines 2210 to 2216
// Whether the type is still pending.
//
// TODO: A generalized sanity check function for all type functions?
// But it should be optional for customization
// for functions that specifically need type function
// This here fixes a stack overflow.
// https://github.com/luau-lang/luau/issues/1406
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove all of this comment? isPending is the "generalized sanity check" that should be called for each type parameter to a type function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, give me a second

@aatxe aatxe merged commit f2488bd into luau-lang:master Sep 13, 2024
7 checks passed
@karl-police karl-police deleted the index_not_pending_stackoverflow_fix1 branch September 13, 2024 18:48
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