[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: clang memory sanitizer report unsigned int overflow
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 5 Jan 2023 11:05:59 -0300
> For reference that is this line marked with **:
>
> | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed)
> {
> | unsigned int h = seed ^ cast_uint(l);
> | for (; l > 0; l--)
> **| h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1]));
> | return h;
> | }
>
> Though not sure which part of that would be causing an add overflow because
> h is an unsigned int which I believe should not trigger UB when it
> overflows.
The 'reason' itself states "Unsigned integer overflow", which does not
exist in ISO C...
Process 626150 stopped
* thread #1, name = 'ufsrv', stop reason = Unsigned integer overflow
??????????????????????????????????
-- Roberto