summaryrefslogtreecommitdiff
path: root/sys/dev/microcode/isp
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-06-15 20:46:45 +0000
committerrillig <rillig@NetBSD.org>2021-06-15 20:46:45 +0000
commitba1fb2c0883f988138919ea88c7d5a0bc74310ed (patch)
treeefaa34f67574174cedc9a9b2d49abfb3c63157bb /sys/dev/microcode/isp
parent7e497a062bcfe6c911c2e0e9bc50dfc6086b37a2 (diff)
lint: replace array access with function calls
First and foremost, the test d_c99_complex_split accessed the array qlmasks out-of-bounds, with an index of 128 for the type 'double _Complex'. This invoked undefined behavior since the maximum allowed index was 64. Replacing the raw array accesses with function calls allows for bounds checks to catch these errors early. Determining the value bits for a 'double _Complex' does not make sense at all since it is not an integer type. This means that lint didn't handle these types correctly for several years. Support for int128_t has been added in inittyp.c 1.12 from 2018-09-07, support for _Complex has been added in inittyp.c 1.9 from 2008-04-26. Determining the value bits for an int128_t would make sense, but the unit tests don't contain examples for this type since at the moment all unit tests must produce the same results on 32-bit and 64-bit platforms, and the 32-bit platforms don't support int128_t.
Diffstat (limited to 'sys/dev/microcode/isp')
0 files changed, 0 insertions, 0 deletions