Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov
2017-10-25 14:52:55 +01:00
parent a8b1715b8a
commit 27d5a7bce0

View File

@@ -3653,21 +3653,21 @@ included_in_packed_varying(ir_variable *var, const char *name)
if (strncmp(var->name, "packed:", 7) != 0) if (strncmp(var->name, "packed:", 7) != 0)
return false; return false;
char *list = strdup(var->name + 7); const char *token = var->name + 7;
assert(list);
bool found = false;
char *saveptr;
char *token = strtok_r(list, ",", &saveptr);
while (token) { while (token) {
if (strcmp(token, name) == 0) { const char *next_token = strchr(list, ' ');
found = true; if (next_token) {
break; len = token - next_token;
next_token++;
} else {
len = strlen(token);
} }
token = strtok_r(NULL, ",", &saveptr); if (strncmp(token, name, MAX2(len, strlen(name)) == 0)
return true;
token = next_token;
} }
free(list); return false;
return found;
} }
/** /**