Skip to content

Commit 31f2dba

Browse files
committed
backend: fix ICE segfault on empty static loops
gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_constant_expression): Check if t is a NULL_TREE Signed-off-by: Tom Schollenberger <[email protected]>
1 parent 11d46d4 commit 31f2dba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gcc/rust/backend/rust-constexpr.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,11 @@ eval_constant_expression (const constexpr_ctx *ctx, tree t, bool lval,
19011901

19021902
location_t loc = EXPR_LOCATION (t);
19031903

1904-
if (CONSTANT_CLASS_P (t))
1904+
if (t == NULL_TREE)
1905+
{
1906+
return t;
1907+
}
1908+
else if (CONSTANT_CLASS_P (t))
19051909
{
19061910
if (TREE_OVERFLOW (t))
19071911
{

0 commit comments

Comments
 (0)