Additional ERR_PANIC/ERR_FATAL -> nasm_panic/nasm_fatal changes

Additional places where we can change ERR_PANIC and ERR_FATAL to
nasm_panic and nasm_fatal.  Note that nasm_panic and nasm_fatal should
*aways* be expected to be fatal; they should never be used in a
suppressed context.  It is critical that we verify that this doesn't
break anything.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2016-03-03 14:36:01 -08:00
parent 215186fe82
commit d6d1b65826
3 changed files with 12 additions and 12 deletions

View file

@ -347,7 +347,7 @@ static void out(int64_t offset, int32_t segto, const void *data,
uint8_t *q = p;
if (asize > 8) {
nasm_error(ERR_PANIC, "OUT_ADDRESS with size > 8");
nasm_panic(0, "OUT_ADDRESS with size > 8");
return;
}
@ -590,7 +590,7 @@ int64_t assemble(int32_t segment, int64_t offset, int bits, iflag_t cp,
int64_t insn_size = calcsize(segment, offset, bits, instruction, temp);
itimes = instruction->times;
if (insn_size < 0) /* shouldn't be, on pass two */
nasm_error(ERR_PANIC, "errors made it through from pass one");
nasm_panic(0, "errors made it through from pass one");
else
while (itimes--) {
for (j = 0; j < MAXPREFIX; j++) {
@ -696,7 +696,7 @@ int64_t assemble(int32_t segment, int64_t offset, int bits, iflag_t cp,
case P_none:
break;
default:
nasm_error(ERR_PANIC, "invalid instruction prefix");
nasm_panic(0, "invalid instruction prefix");
}
if (c != 0) {
out(offset, segment, &c, OUT_RAWDATA, 1,
@ -1300,7 +1300,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
break;
default:
nasm_error(ERR_PANIC, "internal instruction table corrupt"
nasm_panic(0, "internal instruction table corrupt"
": instruction code \\%o (0x%02X) given", c, c);
break;
}
@ -1821,7 +1821,7 @@ static void gencode(int32_t segment, int64_t offset, int bits,
case 0340:
if (ins->oprs[0].segment != NO_SEG)
nasm_error(ERR_PANIC, "non-constant BSS size in pass two");
nasm_panic(0, "non-constant BSS size in pass two");
else {
int64_t size = ins->oprs[0].offset;
if (size > 0)
@ -1966,7 +1966,7 @@ static void gencode(int32_t segment, int64_t offset, int bits,
break;
default:
nasm_error(ERR_PANIC, "internal instruction table corrupt"
nasm_panic(0, "internal instruction table corrupt"
": instruction code \\%o (0x%02X) given", c, c);
break;
}
@ -1976,14 +1976,14 @@ static void gencode(int32_t segment, int64_t offset, int bits,
static opflags_t regflag(const operand * o)
{
if (!is_register(o->basereg))
nasm_error(ERR_PANIC, "invalid operand passed to regflag()");
nasm_panic(0, "invalid operand passed to regflag()");
return nasm_reg_flags[o->basereg];
}
static int32_t regval(const operand * o)
{
if (!is_register(o->basereg))
nasm_error(ERR_PANIC, "invalid operand passed to regval()");
nasm_panic(0, "invalid operand passed to regval()");
return nasm_regvals[o->basereg];
}
@ -1993,7 +1993,7 @@ static int op_rexflags(const operand * o, int mask)
int val;
if (!is_register(o->basereg))
nasm_error(ERR_PANIC, "invalid operand passed to op_rexflags()");
nasm_panic(0, "invalid operand passed to op_rexflags()");
flags = nasm_reg_flags[o->basereg];
val = nasm_regvals[o->basereg];

2
eval.c
View file

@ -756,7 +756,7 @@ static int64_t eval_ifunc(int64_t val, enum ifunc func)
break;
default:
nasm_error(ERR_PANIC, "invalid IFUNC token %d", func);
nasm_panic(0, "invalid IFUNC token %d", func);
rv = 0;
break;
}

View file

@ -733,7 +733,7 @@ static int to_float(const char *str, int s, uint8_t *result,
const char *strend;
if (!str[0]) {
nasm_error(ERR_PANIC,
nasm_panic(0,
"internal errror: empty string passed to float_const");
return 0;
}
@ -916,7 +916,7 @@ int float_const(const char *number, int sign, uint8_t *result, int bytes)
case 16:
return to_float(number, sign, result, &ieee_128);
default:
nasm_error(ERR_PANIC, "strange value %d passed to float_const", bytes);
nasm_panic(0, "strange value %d passed to float_const", bytes);
return 0;
}
}