Fix another UBSan error in awk

This applies my upstreamed fix: ad9bd2f40a
Found By:	UBSan
This commit is contained in:
Alex Richardson 2020-09-21 19:03:12 +00:00
parent ae692c42cb
commit 1116946093

View File

@ -467,9 +467,8 @@ int word(char *w)
int c, n; int c, n;
n = binsearch(w, keywords, sizeof(keywords)/sizeof(keywords[0])); n = binsearch(w, keywords, sizeof(keywords)/sizeof(keywords[0]));
/* BUG: this ought to be inside the if; in theory could fault (daniel barrett) */
kp = keywords + n;
if (n != -1) { /* found in table */ if (n != -1) { /* found in table */
kp = keywords + n;
yylval.i = kp->sub; yylval.i = kp->sub;
switch (kp->type) { /* special handling */ switch (kp->type) { /* special handling */
case BLTIN: case BLTIN: