ensure uN and iN types are clamped to 0-65535

This commit is contained in:
Meghan Denny 2021-09-30 18:46:35 -07:00
parent 50022e5d24
commit 0406f7cc93

View File

@ -623,6 +623,7 @@ pub fn isTypeIdent(tree: Analysis.Tree, token_idx: Ast.TokenIndex) bool {
if (text.len == 1) return false;
if (!(text[0] == 'u' or text[0] == 'i')) return false;
if (!allDigits(text[1..])) return false;
_ = std.fmt.parseUnsigned(u16, text[1..], 10) catch return false;
return true;
}