From a4253ed48469c52060ca5a5eb406b7bf2d461fce Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 17 Apr 2014 14:21:15 +0100 Subject: [PATCH] Don't aver in writef: typically called from debugger where we want a best effort. Copied from Perforce Change: 185629 ServerID: perforce.ravenbrook.com --- mps/code/mpm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mps/code/mpm.c b/mps/code/mpm.c index 99cccb2ae4f..155235e83d0 100644 --- a/mps/code/mpm.c +++ b/mps/code/mpm.c @@ -470,10 +470,8 @@ Res WriteF_firstformat_v(mps_lib_FILE *stream, break; while(*format != '\0') { - if (*format == '}') { - AVER(depth > 0); + if (*format == '}' && depth > 0) -- depth; - } if (line_start) { for (i = 0; i < depth; ++i) { r = mps_lib_fputs(" ", stream); @@ -516,7 +514,7 @@ Res WriteF_firstformat_v(mps_lib_FILE *stream, case 'F': { /* function */ WriteFF f = va_arg(args, WriteFF); Byte *b = (Byte *)&f; - /* ISO C forbits casting function pointers to integer, so + /* ISO C forbids casting function pointers to integer, so decode bytes (see design.writef.f). TODO: Be smarter about endianness. */ for(i=0; i < sizeof(WriteFF); i++) {