Skip to content

Commit b8d5b84

Browse files
committed
extract_key: allow missing keys in table
The table examined by extract_key is assumed to start at entry 0, but for a table keyed on enum isl_ast_node_type, which will be needed in the next commit, there is no entry 0 because the first non-error value is 1 rather than 0. It is not clear why enum isl_ast_node_type starts at 1, but since these values appear in public headers, it seems prudent not to change them. Signed-off-by: Sven Verdoolaege <[email protected]>
1 parent 3071f3e commit b8d5b84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extract_key.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static KEY KEY_EXTRACT(__isl_keep isl_stream *s, struct isl_token *tok)
3434
return KEY_ERROR;
3535

3636
for (key = 0; key < KEY_END; ++key) {
37-
if (!strcmp(name, KEY_STR[key]))
37+
if (KEY_STR[key] && !strcmp(name, KEY_STR[key]))
3838
break;
3939
}
4040
free(name);

0 commit comments

Comments
 (0)