Ciao,

Il Ven, 20 Settembre 2019 5:33 pm, Andrew Wock ha scritto:
> The t-sqrlo test invokes undefined behavior.

Yes, also Valgrind detects it...

> The mpn_ptr scratch as well as the boundary values of the mpn_ptr pp are
> uninitialized values.

Not exactly, only scratch is uninitialised.

> I was able to get the tests to pass by simply memset()ting scratch to any

The simpler workaround consists in activating the code that is available
in the source, but was disabled by the author (me!) for some unknown
reason...

I pushed the following:
https://gmplib.org/repo/gmp/rev/0688aef1f7e3

--- a/tests/mpn/t-sqrlo.c       Mon Sep 16 22:18:22 2019 +0200
+++ b/tests/mpn/t-sqrlo.c       Fri Sep 20 20:20:09 2019 +0200
@@ -83,10 +83,8 @@
       p_after = pp[n];

       itch = mpn_sqrlo_itch (n);
-#if 0
       ASSERT_ALWAYS (itch <= mpn_sqrlo_itch (MAX_N));
       mpn_random2 (scratch-1, itch+2);
-#endif
       s_before = scratch[-1];
       s_after = scratch[itch];


Ĝis,
m

-- 
http://bodrato.it/papers/

_______________________________________________
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs

Reply via email to