add code to prevent segfault during Eval of thunk Expr#35429
Merged
IanButterworth merged 7 commits intoJuliaLang:masterfrom Jan 28, 2023
Merged
add code to prevent segfault during Eval of thunk Expr#35429IanButterworth merged 7 commits intoJuliaLang:masterfrom
IanButterworth merged 7 commits intoJuliaLang:masterfrom
Conversation
Member
|
Yes, I don't think this is correct because it doesn't actually check the structure. It checks much later, when having the wrong structure might have resulted in some null pointers, but only if you're lucky. |
src/toplevel.c
Outdated
| @@ -791,7 +794,11 @@ jl_value_t *jl_toplevel_eval_flex(jl_module_t *JL_NONNULL m, jl_value_t *e, int | |||
| thk = (jl_code_info_t*)jl_exprarg(ex, 0); | |||
| assert(jl_is_code_info(thk)); | |||
Member
There was a problem hiding this comment.
I think it would be enough to turn this assert into an error.
Contributor
Author
|
@JeffBezanson Changed the assert to error in a7c56d7. Now all 3 of the examples no longer segfault. |
This file contains hidden or 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
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.
Description
Trying to address issue #32315.
I have a feeling this isn't correct, but trying to code against the situation where a
:thunkExpris passed toEvalwith incorrect values.For example the following now would have an error returned where they previously segfaulted.
Although the following does still segfault:
Closes #32315