mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:50:13 +01:00
Formatter: don't crash on unexpected SemIR. (#6787)
The formatter is used as a debugging tool, so shouldn't crash if the SemIR is in an unexpected shape.
This commit is contained in:
@@ -733,7 +733,9 @@ auto Formatter::FormatParamList(InstBlockId params_id, InstId return_form_id)
|
||||
out() << "invalid";
|
||||
continue;
|
||||
}
|
||||
CARBON_CHECK(!sem_ir_->insts().Is<OutParam>(param_id));
|
||||
if (sem_ir_->insts().Is<OutParam>(param_id)) {
|
||||
out() << "<unexpected out> ";
|
||||
}
|
||||
FormatNameAndForm(param_id, sem_ir_->insts().Get(param_id));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user