From 0406f7cc93b30f0794a6a34df4c2cc64ebe45dc9 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 30 Sep 2021 18:46:35 -0700 Subject: [PATCH] ensure uN and iN types are clamped to 0-65535 --- src/analysis.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/analysis.zig b/src/analysis.zig index 0adff1c..1f2e22f 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -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; }