Commit ea9b01d4 by Ian Lance Taylor

re PR go/61246 (gccgo: ICE in do_determine_types [GoSmith])

	PR go/61246
compiler: Switch expression comparisons should be boolean typed.

From-SVN: r218794
parent e49aee92
...@@ -3857,7 +3857,11 @@ Switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing, ...@@ -3857,7 +3857,11 @@ Switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
Expression* val = this->val_; Expression* val = this->val_;
if (val == NULL) if (val == NULL)
val = Expression::make_boolean(true, loc); val = Expression::make_boolean(true, loc);
Temporary_statement* val_temp = Statement::make_temporary(NULL, val, loc);
Type* type = val->type();
if (type->is_abstract())
type = type->make_non_abstract_type();
Temporary_statement* val_temp = Statement::make_temporary(type, val, loc);
b->add_statement(val_temp); b->add_statement(val_temp);
this->clauses_->lower(b, val_temp, this->break_label()); this->clauses_->lower(b, val_temp, this->break_label());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment