Bug 582191 - nanojit: fix formatImm[IQ] bogons. r=edwsmith.

--HG--
extra : convert_revision : ce704edcab9d092627ad29e60efc0991ee2682e0
This commit is contained in:
Nicholas Nethercote 2010-07-28 17:06:14 -07:00
parent 06143a5acb
commit bdd9c63662
2 changed files with 6 additions and 6 deletions

View File

@ -1627,7 +1627,7 @@ namespace nanojit
}
char* LInsPrinter::formatImmI(RefBuf* buf, int32_t c) {
if (-10000 < c || c < 10000) {
if (-10000 < c && c < 10000) {
VMPI_snprintf(buf->buf, buf->len, "%d", c);
} else {
#if !defined NANOJIT_64BIT
@ -1639,18 +1639,16 @@ namespace nanojit
return buf->buf;
}
#if defined NANOJIT_64BIT
char* LInsPrinter::formatImmQ(RefBuf* buf, uint64_t c) {
if (-10000 < (int64_t)c || c < 10000) {
if (-10000 < (int64_t)c && c < 10000) {
VMPI_snprintf(buf->buf, buf->len, "%dLL", (int)c);
} else {
#if defined NANOJIT_64BIT
formatAddr(buf, (void*)c);
#else
VMPI_snprintf(buf->buf, buf->len, "0x%llxLL", c);
#endif
}
return buf->buf;
}
#endif
char* LInsPrinter::formatImmD(RefBuf* buf, double c) {
VMPI_snprintf(buf->buf, buf->len, "%g", c);

View File

@ -1742,7 +1742,9 @@ namespace nanojit
const int EMB_NUM_USED_ACCS;
char *formatImmI(RefBuf* buf, int32_t c);
#ifdef NANOJIT_64BIT
char *formatImmQ(RefBuf* buf, uint64_t c);
#endif
char *formatImmD(RefBuf* buf, double c);
void formatGuard(InsBuf* buf, LIns* ins); // defined by the embedder
void formatGuardXov(InsBuf* buf, LIns* ins); // defined by the embedder