llvm-project
6b8d072c - [libc] Fix incorrect unsigned comparison (#135595)

Commit
202 days ago
[libc] Fix incorrect unsigned comparison (#135595) There is a problem with such unsigned comparison pattern: ``` if(unsigned_a - unsigned_b > 0) { /* only NOT go here when unsigned_a==unsigned_b */ } ``` When `unsigned_a` < `unsigned_b`, the result will still be `>0` due to underflow. This patch fixes two of the occurrences I found. Also remove two redundant `if` where its condition is guaranteed by outer `if`.
Author
Parents
Loading