ponyc: Potential compiler segfault in lookup.c
This code is a bit bogus. If opt can be NULL, the declaration typecheck_t* t = &opt->check;
could crash the compiler. In any case, it looks like the t declaration could be safely moved into the scope of the if-branch, where it is properly guarded against opt == NULL.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 21 (21 by maintainers)
Commits related to this issue
- Fix for crash involving the use of private types used as default values This attempts to fix issues #4130 and #4153. The issue was when a private type in another package was used as a default value ... — committed to stefandd/ponyc by stefandd 2 years ago
- Fix for crash involving the use of private types used as default values This attempts to fix #4130 This crash stems from the use of a private type as defined in another package when it was used as a... — committed to stefandd/ponyc by stefandd 2 years ago
- Attempt to fix #4153 — committed to stefandd/ponyc by stefandd 2 years ago
@stefandd - We already have the
opt
here in this scope (it’s the last parameter received byadd_special
) so in my opinion there’s no reason to passNULL
tolookup_try
- we should pass the realopt
.