aboutsummaryrefslogtreecommitdiff
path: root/scripts/generate_rust_analyzer.py
diff options
context:
space:
mode:
authorZhen Lei <[email protected]>2022-11-25 17:13:58 +0800
committerAl Viro <[email protected]>2022-11-25 15:43:39 -0500
commitea258f159da14a710f9cb88656558538b5ba5b76 (patch)
tree581f2519c1d3d0e184474076f5d7c1fa61a59a47 /scripts/generate_rust_analyzer.py
parentcf260db405b1a159e9076220b40f5f02ac480525 (diff)
get rid of INT_LIMIT, use type_max() instead
INT_LIMIT() tries to do what type_max() does, except that type_max() doesn't rely upon undefined behaviour[*], might as well use type_max() instead. [*] if T is an N-bit signed integer type, the maximal value in T is pow(2, N - 1) - 1, all right, but naive expression for that value ends up with a couple of wraparounds and as usual for wraparounds in signed types, that's an undefined behaviour. type_max() takes care to avoid those... Caught-by: UBSAN Suggested-by: Eric Biggers <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Signed-off-by: Al Viro <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions