about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorokaneco <47607823+okaneco@users.noreply.github.com>2024-02-21 21:44:30 -0500
committerokaneco <47607823+okaneco@users.noreply.github.com>2024-03-04 18:46:09 -0500
commit31c758e052e98f387b6de008238023afa0309c53 (patch)
tree152b8847ff740b10bfc9211aab7731ebf77007da /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent3406ada96f8e16e49e947a91db3eba0db45245fa (diff)
downloadrust-31c758e052e98f387b6de008238023afa0309c53.tar.gz
rust-31c758e052e98f387b6de008238023afa0309c53.zip
net: Add branch to Parser::read_number for parsing without checked
arithmetic

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 well within a `u32` without risk of overflow. Thus, we can use
plain arithmetic to avoid extra instructions from `checked_mul` and
`checked_add`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions