-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
add code to prevent segfault during Eval of thunk Expr #35429
Conversation
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)); |
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.
I think it would be enough to turn this assert into an error.
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.
Changed the assert to error in a7c56d7
@JeffBezanson Changed the assert to error in a7c56d7. Now all 3 of the examples no longer segfault.
|
Description
Trying to address issue #32315.
I have a feeling this isn't correct, but trying to code against the situation where a
:thunk
Expr
is passed toEval
with incorrect values.For example the following now would have an error returned where they previously segfaulted.
Although the following does still segfault:
Closes #32315