prevent underflow in ast.zig#fullWhile() (#848)

This commit is contained in:
travisstaloch 2022-12-25 14:44:25 -08:00 committed by GitHub
parent f6c15ac10c
commit faae689ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ fn fullWhile(tree: Ast, info: full.While.Components) full.While {
.else_token = undefined,
.error_token = null,
};
var tok_i = info.while_token - 1;
var tok_i = info.while_token -| 1;
if (token_tags[tok_i] == .keyword_inline) {
result.inline_token = tok_i;
tok_i -= 1;