diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-07-19 22:05:21 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2018-07-20 14:02:21 +0000 |
commit | 6979c547933901b21dab28e2c08fd4cc730f9860 (patch) | |
tree | ead7af152e02670dba1eab7cef28c8dbe99627b5 /src/gsm/sysinfo.c | |
parent | f81d03f7dd67db4a814fea8559e4d459c7a31ec9 (diff) |
utils_test: fix isqrt_test calculation range
Multiplying the uint16_t x by itself seems to default to be calculated in
int32_t range, while it obviously needs uint32_t. This causes sporadic
sanitizer barfs:
Testing integer square-root
utils_test.c:445:18: runtime error: signed integer overflow: 60369 * 60369 cannot be represented in type 'int'
The final result is still correct, because it is in fact interpreted as uint32_t.
Cast to uint32_t to make sure the sanitizer doesn't complain.
Related: OS#3407
Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d
Diffstat (limited to 'src/gsm/sysinfo.c')
0 files changed, 0 insertions, 0 deletions