Fix tree-optimization/78886.
[gcc.git] / gcc / tree-ssa-strlen.c
index 67075f07e2962726c5585431ffe8f4aabf8efa7f..4a05725ca7c4508ab60a7f3f99587da9b8cc2bd0 100644 (file)
@@ -1869,6 +1869,9 @@ handle_builtin_malloc (enum built_in_function bcode, gimple_stmt_iterator *gsi)
 {
   gimple *stmt = gsi_stmt (*gsi);
   tree lhs = gimple_call_lhs (stmt);
+  if (lhs == NULL_TREE)
+    return;
+
   gcc_assert (get_stridx (lhs) == 0);
   int idx = new_stridx (lhs);
   tree length = NULL_TREE;