summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-03-03 14:36:01 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-03-03 15:22:03 -0800
commitd6d1b658263a035beb592a794184bf2e0ea1ef01 (patch)
tree9a6c98cc2437cdc2dbbff71174bd3ea48f2d20ab
parent215186fe82c461bc1ccef7bed5c1a1a0253bfcc9 (diff)
downloadnasm-d6d1b658263a035beb592a794184bf2e0ea1ef01.tar.gz
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>
-rw-r--r--assemble.c18
-rw-r--r--eval.c2
-rw-r--r--float.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/assemble.c b/assemble.c
index a26f2bf6..f051b26d 100644
--- a/assemble.c
+++ b/assemble.c
@@ -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];
diff --git a/eval.c b/eval.c
index a8e463f2..72e13c9d 100644
--- a/eval.c
+++ b/eval.c
@@ -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;
}
diff --git a/float.c b/float.c
index adf18c5b..e30e1eff 100644
--- a/float.c
+++ b/float.c
@@ -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;
}
}