-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
GDScript: Fix segfault on invalid script #92035
GDScript: Fix segfault on invalid script #92035
Conversation
Haven't tested the MRP of the linked issue yet, but tested briefly on another project I had locally with a parse error, and it adds another IMO unnecessary error message to the pre-existing error spam:
A non-descriptive error like |
Tested with the MRP from #92021, I confirm this fixes the segfault on start, but I notice there's a segfault on exit:
Additionally, the project doesn't work once exported, even though it works in the editor. This might be a separate issue from #92021 but there's still more work needed (here or in another PR), if a project works in the editor it ought to work once exported too. |
i see, ill take out the error print its funny i actually partially made this fix a while ago for my own branch and just didnt have the motivation to make a PR until now |
39c6a99
to
9fa13da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! |
This PR causes a regression in projects which access inner classes from `const foo: GDScript = preload("./foo.gd"): Steps to reproduce:
This issue does not reproduce when this PR is backed out. The MRP works fine in Godot 4.0.3 through May 17 bd2300d. |
gdscript compiler sets script as not valid if
GDScriptCache::finish_compiling()
failsvarious
GDScript
andGDScriptInstance
functions now have checks to avoid calling any gdscipt function on an invalid gdscript instance, bc theres many ways to get a hold of an invalid gdscript and many places where the validity of a gdscript isnt checkedfixes #92021