mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-16 17:01:53 +00:00
[qfcc] Mask off base register bits when printing statements
Fixes a segfault when compiling Ruamoko progs with debug output.
This commit is contained in:
parent
ee4eecc741
commit
982a090143
1 changed files with 6 additions and 3 deletions
|
@ -403,11 +403,14 @@ void
|
|||
opcode_print_statement (pr_uint_t addr, dstatement_t *st)
|
||||
{
|
||||
const char *mnemonic;
|
||||
// this is ok because v6p has < 300 instructions
|
||||
int st_op = st->op & 0x1ff;
|
||||
|
||||
if (options.code.progsversion < PROG_VERSION) {
|
||||
mnemonic = v6p_opcode_map[st->op].opname;
|
||||
mnemonic = v6p_opcode_map[st_op].opname;
|
||||
} else {
|
||||
mnemonic = pr_opcodes[st->op].mnemonic;
|
||||
mnemonic = pr_opcodes[st_op].mnemonic;
|
||||
}
|
||||
printf ("%04x (%03x)%-8s %04x %04x %04x\n",
|
||||
addr, st->op & 0x1ff, mnemonic, st->a, st->b, st->c);
|
||||
addr, st_op & 0x1ff, mnemonic, st->a, st->b, st->c);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue