Commit 7005c8a4 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Correct some off-by-one errors in ia32_emitf().

parent 4b34dcdf
......@@ -575,7 +575,7 @@ emit_AM:
break;
case 'D':
if (*fmt < '0' || '9' <= *fmt)
if (*fmt < '0' || '9' < *fmt)
goto unknown;
reg = arch_get_irn_register_out(node, *fmt++ - '0');
goto emit_R;
......@@ -587,7 +587,7 @@ emit_AM:
} else if (*fmt == 'X') {
++fmt;
ia32_emit_xmm_mode_suffix(node);
} else if ('0' <= *fmt && *fmt <= '3') {
} else if ('0' <= *fmt && *fmt <= '2') {
const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
be_emit_char('%');
be_emit_string(attr->x87[*fmt++ - '0']->name);
......@@ -657,7 +657,7 @@ emit_S:
case 'S': {
unsigned pos;
if (*fmt < '0' || '9' <= *fmt)
if (*fmt < '0' || '9' < *fmt)
goto unknown;
pos = *fmt++ - '0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment