diff options
| author | bors <bors@rust-lang.org> | 2024-03-05 15:29:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-05 15:29:19 +0000 |
| commit | 96561a8fd134e8f2b205769a4fca03b392d9f484 (patch) | |
| tree | 668dfa870b080edc82b4092505d1572438933c73 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | c7beecf3e3cef7a8226a99aec4e4f6bfc114ba8e (diff) | |
| parent | 69637c921297a49c3a80874cb2f5dd37f7a7ddd6 (diff) | |
| download | rust-96561a8fd134e8f2b205769a4fca03b392d9f484.tar.gz rust-96561a8fd134e8f2b205769a4fca03b392d9f484.zip | |
Auto merge of #121428 - okaneco:ipaddr_parse, r=cuviper
net: Don't use checked arithmetic when parsing numbers with known max digits Add a branch to `Parser::read_number` that determines whether checked or regular arithmetic is used. - If `max_digits.is_some()`, then we know we are parsing a `u8` or `u16` because `read_number` is only called with `Some(3)` or `Some(4)`. Both types fit within a `u32` without risk of overflow. Thus, we can use plain arithmetic to avoid extra instructions from `checked_mul` and `checked_add`. Add benches for `IpAddr`, `Ipv4Addr`, `Ipv6Addr`, `SocketAddr`, `SocketAddrV4`, and `SocketAddrV6` parsing
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
