The panic in test/fixedbugs/bug454.go was caused by the generation of an unnecessary var reference when writing a range value into a sink. If the receiving variable is a sink, there's no need to dereference a possible NULL pointer.
Fixes Issue 24.
From-SVN: r201815
no->var_value()->set_type_from_range_value();
if (is_new)
any_new = true;
- p_range_clause->value = Expression::make_var_reference(no, location);
+ if (!Gogo::is_sink_name(pti->name()))
+ p_range_clause->value = Expression::make_var_reference(no, location);
}
if (!any_new)