Skip to content

Commit

Permalink
gccrs: fix crash in hir dump
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* hir/rust-hir-dump.cc (Dump::visit): add missing check for no return value

Signed-off-by: Philip Herron <[email protected]>
  • Loading branch information
philberty committed Dec 2, 2024
1 parent 7a081b0 commit 9e07940
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/rust/hir/rust-hir-dump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,8 @@ Dump::visit (ReturnExpr &e)
begin ("ReturnExpr");
do_mappings (e.get_mappings ());

visit_field ("return_expr", e.get_expr ());
if (e.has_return_expr ())
visit_field ("return_expr", e.get_expr ());

end ("ReturnExpr");
}
Expand Down

0 comments on commit 9e07940

Please sign in to comment.