Skip to content

Commit 9e07940

Browse files
committed
gccrs: fix crash in hir dump
gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): add missing check for no return value Signed-off-by: Philip Herron <herron.philip@googlemail.com>
1 parent 7a081b0 commit 9e07940

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/rust/hir/rust-hir-dump.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,8 @@ Dump::visit (ReturnExpr &e)
13651365
begin ("ReturnExpr");
13661366
do_mappings (e.get_mappings ());
13671367

1368-
visit_field ("return_expr", e.get_expr ());
1368+
if (e.has_return_expr ())
1369+
visit_field ("return_expr", e.get_expr ());
13691370

13701371
end ("ReturnExpr");
13711372
}

0 commit comments

Comments
 (0)