printf/repl-vsnprintf.c bug (was: GMP|MPIR|MPFR assertions)

Vincent Lefevre vincent at vinc17.net
Thu Jan 18 14:07:08 UTC 2018


On 2018-01-18 14:16:41 +0100, Vincent Lefevre wrote:
> [Cc to gmp-bugs]
> 
> On 2018-01-18 23:14:12 +1100, sisyphus1 at optusnet.com.au wrote:
> > Just had a reply on the mingw64 mailing list.
> > Apparently, the test programs are not crashing - abort() is being called
> > following an assertion failure.
> > And this calls for a "break abort" prior to "run" being called.
> > 
> > See attached backtrace for tfprintf.exe. (I could supply equivalent for the
> > other 2 failing test programs - but I think they're essentially the same.)
> 
> printf/repl-vsnprintf.c seems buggy for floating-point specifiers
> (EeGgFf). Replace "break" by "goto next" (2 occurrences)?

Proposed patch attached. Not tested.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
-------------- next part --------------
diff -r bd031c4d736b printf/repl-vsnprintf.c
--- a/printf/repl-vsnprintf.c	Wed Jan 17 05:34:55 2018 +0100
+++ b/printf/repl-vsnprintf.c	Thu Jan 18 15:05:49 2018 +0100
@@ -243,7 +243,7 @@
 	      }
 	    else
 	      (void) va_arg (ap, double);
-	    break;
+	    goto next;
 
 	  case 'f':
 	    /* Requested decimals, sign and point, and a margin for error,
@@ -264,7 +264,7 @@
 		(void) va_arg (ap, double);
 		total_width += double_digits;
 	      }
-	    break;
+	    goto next;
 
 	  case 'h':  /* short or char */
 	  case 'j':  /* intmax_t */


More information about the gmp-bugs mailing list