-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Don't crash for invalid toplevel parseStmt/Expr calls #23089
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failure is related, investigating Exit codes seem to always be 0 for rejection on windows Fixed: Issue was the error code was read after the process was closed which made it always return 0 on windows |
ire4ever1190
force-pushed
the
fix/recover-invalid-parse
branch
2 times, most recently
from
December 18, 2023 09:49
057b73a
to
f141376
Compare
Needed this for writing the test so that I can still check for errors while also testing that the compiler didn't crash
The error flag is checked after anyways so this shouldn't cause problem This stops the segfault so it is accessing something Alternative solution is to check the error flag ourselves and assign an empty node (Or maybe an error node?) if something goes wrong
File never failed so exit code differing is better error than files differing
…fter messages The other stuff isn't failing for me :/ so think this is the safest option since it should keep backwards compaitability
On windows `peekExitCode` will always return 0 if read after the process is closed
Now I just check the suffix so that editing the file won't have affects
ire4ever1190
force-pushed
the
fix/recover-invalid-parse
branch
from
December 18, 2023 11:28
f141376
to
9028d71
Compare
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
narimiran
pushed a commit
that referenced
this pull request
Apr 19, 2024
This code will crash `check`/`nimsuggest` since the `ra` register is uninitialised ```nim import macros static: discard parseExpr("'") ``` Now it assigns an empty node so that it has something Testament changes were so I could properly write a test. It would pass even with a segfault since it could find the error (cherry picked from commit db9d800)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code will crash
check
/nimsuggest
since thera
register is uninitialisedNow it assigns an empty node so that it has something
Testament changes were so I could properly write a test. It would pass even with a segfault since it could find the error