asm/pragma.c: if the handler is NULL, treat it as DIRR_UNKNOWN

If the handler is NULL, then all pragmas are by definition unknown, so
treat them exactly as if we had received DIRR_UNKNOWN from the
handler.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2017-03-08 20:28:13 -08:00
parent d9493fa440
commit 8753425472

View File

@ -106,6 +106,7 @@ static bool search_pragma_list(const struct pragma_facility *list,
struct pragma *pragma)
{
const struct pragma_facility *pf;
enum directive_result rv;
if (!list)
return false;
@ -121,12 +122,15 @@ static bool search_pragma_list(const struct pragma_facility *list,
return false;
found_it:
if (!pf->handler)
return true;
pragma->facility = pf;
switch (pf->handler(pragma)) {
/* If the handler is NULL all pragmas are unknown... */
if (pf->handler)
rv = pf->handler(pragma);
else
rv = DIRR_UNKNOWN;
switch (rv) {
case DIRR_UNKNOWN:
switch (pragma->opcode) {
case D_none: