analyzer: support null operands in remove_ssa_names

gcc/analyzer/ChangeLog:
	* access-diagram.cc (remove_ssa_names): Support operands being
	NULL_TREE, such as e.g. for COMPONENT_REF's operand 2.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This commit is contained in:
David Malcolm 2024-03-18 18:44:32 -04:00
parent dda96a9d94
commit 3c2827d75e

View file

@ -311,7 +311,8 @@ remove_ssa_names (tree expr)
return SSA_NAME_VAR (expr);
tree t = copy_node (expr);
for (int i = 0; i < TREE_OPERAND_LENGTH (expr); i++)
TREE_OPERAND (t, i) = remove_ssa_names (TREE_OPERAND (expr, i));
if (TREE_OPERAND (expr, i))
TREE_OPERAND (t, i) = remove_ssa_names (TREE_OPERAND (expr, i));
return t;
}