This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/81223] [8 Regression] ICE in instrument_null at gcc/ubsan.c:1230


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81223

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I.e.
--- a/gcc/ubsan.c
+++ b/gcc/ubsan.c
@@ -1228,7 +1228,8 @@ instrument_null (gimple_stmt_iterator gsi, tree t, bool
is_lhs)
   if (TREE_CODE (t) == ADDR_EXPR)
     t = TREE_OPERAND (t, 0);
   tree base = get_base_address (t);
-  if (TREE_CODE (base) == MEM_REF
+  if (base != NULL_TREE
+      && TREE_CODE (base) == MEM_REF
       && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
     instrument_mem_ref (t, base, &gsi, is_lhs);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]