From 764b0d2165ce076abcaee37f1833585d381e9e93 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 4 Feb 2010 10:26:47 +1100 Subject: [PATCH] Bug 543384 - Multi-line assertion that makes jsfunfuzz sad. r=jruderman. --HG-- extra : convert_revision : 42624af8095495e387d20c7e474dcc602694b300 --- js/src/nanojit/LIR.cpp | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/js/src/nanojit/LIR.cpp b/js/src/nanojit/LIR.cpp index 07b7c3de1d3b..b4e461872605 100644 --- a/js/src/nanojit/LIR.cpp +++ b/js/src/nanojit/LIR.cpp @@ -2290,11 +2290,6 @@ namespace nanojit } } -#define HOWTO_DEBUG \ - " One way to debug this: change the failing NanoAssertMsgf(0, ...) call to a\n" \ - " printf(...) call and rerun with verbose output. If you're lucky, this error\n" \ - " message will appear before the block containing the erroneous instruction.\n\n" - void ValidateWriter::typeCheckArgs(LOpcode op, int nArgs, LTy formals[], LIns* args[]) { // Type-check the arguments. @@ -2309,15 +2304,10 @@ namespace nanojit // to be caught by test suites whereas error messages may not // be. NanoAssertMsgf(0, - "\n\n" - "LIR type error (%s):\n" - " in instruction with opcode: %s\n" - " in argument %d with opcode: %s\n" - " argument has type %s, expected %s\n" - HOWTO_DEBUG, - _whereInPipeline, - lirNames[op], - i+1, lirNames[args[i]->opcode()], + "LIR type error (%s): arg %d of '%s' is '%s' " + "which has type %s (expected %s)", + _whereInPipeline, i+1, lirNames[op], + lirNames[args[i]->opcode()], type2string(actual), type2string(formal)); } } @@ -2327,27 +2317,16 @@ namespace nanojit LIns* arg, const char* shouldBeDesc) { NanoAssertMsgf(0, - "\n\n" - " LIR structure error (%s):\n" - " in instruction with opcode: %s\n" - " %s %d has opcode: %s\n" - " it should be: %s\n" - HOWTO_DEBUG, - _whereInPipeline, - lirNames[op], - argDesc, argN, lirNames[arg->opcode()], - shouldBeDesc); + "LIR structure error (%s): %s %d of '%s' is '%s' (expected %s)", + _whereInPipeline, argDesc, argN, + lirNames[op], lirNames[arg->opcode()], shouldBeDesc); } void ValidateWriter::errorPlatformShouldBe(LOpcode op, int nBits) { NanoAssertMsgf(0, - "\n\n" - " LIR structure error (%s):\n" - " %s should only occur on %d-bit platforms\n" - HOWTO_DEBUG, - _whereInPipeline, - lirNames[op], nBits); + "LIR platform error (%s): '%s' should only occur on %d-bit platforms", + _whereInPipeline, lirNames[op], nBits); } void ValidateWriter::checkLInsIsACondOrConst(LOpcode op, int argN, LIns* ins)