driconf: Make sure that the range check on the defaults actually works.

Fixes: 8a05d6ffc6 ("driconf: Make the driver's declarations be structs instead of XML.")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7012>
This commit is contained in:
Eric Anholt 2020-10-05 10:33:28 -07:00 committed by Marge Bot
parent 24b4a63b3d
commit 455bfecdff

View file

@ -157,6 +157,7 @@ driParseOptionInfo(driOptionCache *info,
assert(!optinfo->name); /* No duplicate options in your list. */
optinfo->type = opt->info.type;
optinfo->range = opt->info.range;
XSTRDUP(optinfo->name, name);
switch (opt->info.type) {
@ -181,6 +182,7 @@ driParseOptionInfo(driOptionCache *info,
unreachable("handled above");
}
/* Built-in default values should always be valid. */
assert(checkValue(optval, optinfo));
}
}