|
From: | Chet Ramey |
Subject: | Re: UBSAN error in lib/sh/random.c:79 |
Date: | Tue, 10 Jan 2023 09:53:19 -0500 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 |
On 1/7/23 1:45 PM, Martin Schulte wrote:
Hello! Am Sat, 07 Jan 2023 19:08:06 +0100 schrieb Andreas Schwab <schwab@linux-m68k.org>:On Jan 07 2023, Greg Wooledge wrote: ... I think the original overflow can only happen if the argument of intrand32 is bigger than INT_MAX.Question might be if an overflow does any harm - or maybe even is intended...
Positive-to-negative overflow doesn't hurt the algorithm, but since overflow is undefined behavior, anything can happen. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
[Prev in Thread] | Current Thread | [Next in Thread] |