mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
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:
parent
d9493fa440
commit
8753425472
12
asm/pragma.c
12
asm/pragma.c
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user