Check for NULL stmt in check_all_func_returns
PATCH 1/1 Check for NULL stmt in check_all_func_returns
From: John Levon <[email protected]>
Sometimes, there's nothing on the statement stack.
Signed-off-by John Levon <[email protected]>
Suggested-by Toomas Soome <[email protected]>
--- check_all_func_returns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
check_all_func_returns.c +1 -1
@@ -74,7 +74,7 @@ static void check_func_return(struct expression *expr) stmt =last_ptr_list ((struct ptr_list *)big_statement_stack); -if (stmt->type ==STMT_EXPRESSION && stmt->expression == expr) +if (stmt && stmt->type ==STMT_EXPRESSION && stmt->expression == expr)sm_error ("unchecked function return '%s'" ,expr_to_str (expr->fn)); }
Signature · 1 line
2.23.0
Quoted 6 lines · On Tue, May 12, 2020 at 06:23:48AM -0700, [email protected] wrote:
From: John Levon <[email protected]>
Sometimes, there's nothing on the statement stack.
Signed-off-by John Levon <[email protected]>Suggested-by Toomas Soome <[email protected]>
Thanks! Applied.
regards,
dan carpenter