We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f59728 commit 98e9249Copy full SHA for 98e9249
go/expressions.cc
@@ -18790,7 +18790,7 @@ Composite_literal_expression::lower_array(Type* type)
18790
18791
Named_type* ntype = Type::lookup_integer_type("int");
18792
Integer_type* inttype = ntype->integer_type();
18793
- if (sizeof(index) <= static_cast<size_t>(inttype->bits() * 8)
+ if (sizeof(index) >= static_cast<size_t>(inttype->bits() / 8)
18794
&& index >> (inttype->bits() - 1) != 0)
18795
{
18796
go_error_at(index_expr->location(), "index value overflow");
0 commit comments