From f589fa80289ba9a952b248d0243573221dad71ef Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 6 Mar 2018 17:17:44 +0300 Subject: [PATCH] symbol.h: let is_ptr_type() take NULL pointers When I upgraded to the latest Sparse, I think I erased my local patch so now I get a crashing bug here. Signed-off-by: Dan Carpenter --- symbol.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbol.h b/symbol.h index 32744961..88959603 100644 --- a/symbol.h +++ b/symbol.h @@ -342,6 +342,8 @@ static inline int is_type_type(struct symbol *type) static inline int is_ptr_type(struct symbol *type) { + if (!type) + return 0; if (type->type == SYM_NODE) type = type->ctype.base_type; return type->type == SYM_PTR || type->type == SYM_ARRAY || type->type == SYM_FN; -- 2.11.4.GIT