[LANG] Now requiring tiles have power of 2 number of elements

This commit is contained in:
Philippe Tillet
2021-02-04 16:13:10 -05:00
parent cc84a476a3
commit b8a52c70c9
4 changed files with 25 additions and 25 deletions

View File

@@ -1787,8 +1787,10 @@ QualType Parser::ParseArrayFuncDeclarator(const Token* ident, QualType base) {
Error(ident, "'%s' has incomplete element type", ident->str_.c_str());
}
// return a pointer for tiles in constant memory:
return TileType::New(shape, base);
TileType* ret = TileType::New(shape, base);
if(!ret->CheckPow2NumEl())
Error(ts_.Peek(), "tile must have power of 2 number of elements");
return ret;
} else if (ts_.Try('(')) { // Function declaration
if (base->ToFunc()) {
Error(ts_.Peek(),