asm/error.c: handle warning "all" correctly

warning_alias[0] is "all". It is represented in the loop by
value == NULL; WARN_IDX_ALL does not have an entry in warning_state[]
and so trying to poke it is an error.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2020-06-04 15:46:31 -07:00
parent b1ef4345a9
commit 12df4dd12f

View File

@ -241,8 +241,12 @@ bool set_warning_status(const char *value)
vlen = value ? strlen(value) : 0; vlen = value ? strlen(value) : 0;
/* This is inefficient, but it shouldn't matter... */ /*
for (wa = warning_alias; wa < &warning_alias[NUM_WARNING_ALIAS]; wa++) { * This is inefficient, but it shouldn't matter.
* Note: warning_alias[0] is "all".
*/
for (wa = warning_alias+1;
wa < &warning_alias[NUM_WARNING_ALIAS]; wa++) {
enum warn_index i = wa->warning; enum warn_index i = wa->warning;
if (value) { if (value) {