fix crash when inlining casts of erroneous expressions
Sparse do inlining very early, during expansion, just after (type)
evaluation and before IR linearization, and is done even if some
errors have been found. This means that the inlining must be robust
against erroneous code.
However, during inlining, a cast expression is always dereferenced and
a crash will occur if not valid (in which case it should be null).
Fix this by checking for null cast expressions and directly returning
NULL, like done for the inlining of the other invalid expressions.
Reported-by: kernel test robot <firstname.lastname@example.org>
Reported-by: Yafang Shao <email@example.com>
Reported-by: Yujie Liu <firstname.lastname@example.org>
Signed-off-by: Luc Van Oostenryck <email@example.com>
2 files changed