From b17e1a867d63046b9aac4b3a046e951acaacff86 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 May 2020 10:45:19 -0400 Subject: [PATCH 149/179] FIXME: handle NULL original type in maybe_fold_unaryop --- gcc/analyzer/region-model2.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/analyzer/region-model2.cc b/gcc/analyzer/region-model2.cc index 6eb8b844080..5533860e767 100644 --- a/gcc/analyzer/region-model2.cc +++ b/gcc/analyzer/region-model2.cc @@ -2790,8 +2790,9 @@ region_model2_manager::maybe_fold_unaryop (tree type, enum tree_code op, const svalue2 *arg) { /* Handle redundant casts. */ - if (op == NOP_EXPR && useless_type_conversion_p (arg->get_type (), type)) - return arg; + if (op == NOP_EXPR) + if (arg->get_type () && useless_type_conversion_p (arg->get_type (), type)) + return arg; /* Constants. */ if (tree cst = arg->maybe_get_constant ()) -- 2.21.0