Re: Latest commit introduces undefined behavior in hgcd2.c

2019-09-20 Thread Hans Åberg
> On 18 Sep 2019, at 21:37, Niels Möller wrote: > > …a problem, at least in theory, if it is "undefined behavior". I'm afraid I > don't know these fine details of the C spec by heart. It is undefined behavior according to the section “Shift operators” in https://en.cppreference.com/w/c/langua

Undefined behavior in t-sqrlo test

2019-09-20 Thread Andrew Wock
The t-sqrlo test invokes undefined behavior. The mpn_ptr scratch as well as the boundary values of the mpn_ptr pp are uninitialized values. In t-sqrlo.c their values are recorded (lines 92,93,100,101) before mpn_sqrlo and mpn_sqr are called. Their values are subsequently checked (lines 105,106)

Re: Undefined behavior in t-sqrlo test

2019-09-20 Thread Marco Bodrato
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 wa