{"push_id":586009536,"size":44,"distinct_size":44,"ref":"refs/heads/arith-overflow","head":"e6da3e6da4e0a9a93d10515a9438704670489085","before":"5094b24e583850da5aef24593970861a7810bf12","commits":[{"sha":"12ff3d1d6b8969f8bbacc728e117ee5cd8979ee5","author":{"email":"9db1eb270958b3a258acf36f0c6cac890fbeca97@octayn.net","name":"Corey Richardson"},"message":"rustc: implement arithmatic overflow checking\n\nAdds overflow checking to integer addition, multiplication, and subtraction\nwhen `-Z force-overflow-checks` is true, or if `--cfg ndebug` is not passed to\nthe compiler. On overflow, it panics with `arithmatic operation overflowed`.\nAlso adds `overflowing_add`, `overflowing_sub`, and `overflowing_mul`\nintrinsics for doing unchecked arithmatic.\n\n[breaking-change]","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/12ff3d1d6b8969f8bbacc728e117ee5cd8979ee5"},{"sha":"d90f0b4ebaf0d039d55674b725a8557caf00be4c","author":{"email":"474ba67bdb289c6263b36dfd8a7bed6c85b04943@aatch.net","name":"James Miller"},"message":"Add Wrapping<T> and WrappingOps implementations\n\nAdds a Wrapping<T> wrapper type and a WrappingOps trait for allowing\npeople to explictly opt-in to wrapping integer arithmetic.\n\nThis commit currently disables overflow checking in the build due to\ncases of expected overflow triggering the panic.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/d90f0b4ebaf0d039d55674b725a8557caf00be4c"},{"sha":"39ea4cce3962416543bca0c3b8ddcd5d097fea2d","author":{"email":"474ba67bdb289c6263b36dfd8a7bed6c85b04943@aatch.net","name":"James Miller"},"message":"Fix overflow errors\n\nMany of the core rust libraries have places that rely on integer\nwrapping behaviour. These places have been altered to use the wrapping_*\nmethods:\n\n * core::hash::sip - A number of macros\n * core::str - The `maximal_suffix` method in `TwoWaySearcher`\n * rustc::util::nodemap - Implementation of FnvHash\n * rustc_back::sha2 - A number of macros and other places\n * rand::isaac - Isaac64Rng, changed to use the Wrapping helper type\n\nSome places had \"benign\" underflow. This is when underflow or overflow\noccurs, but the unspecified value is not used due to other conditions.\n\n * collections::bit::Bitv - underflow when `self.nbits` is zero.\n * collections::hash::{map,table} - Underflow when searching an empty\n   table. Did cause undefined behaviour in this case due to an\n   out-of-bounds ptr::offset based on the underflowed index. However the\n   resulting pointers would never be read from.\n * syntax::ext::deriving::encodable - Underflow when calculating the\n   index of the last field in a variant with no fields.\n\nThese cases were altered to avoid the underflow, often by moving the\nunderflowing operation to a place where underflow could not happen.\n\nThere was one case that relied on the fact that unsigned arithmetic and\ntwo's complement arithmetic are identical with wrapping semantics. This\nwas changed to use the wrapping_* methods.\n\nFinally, the calculation of variant discriminants could overflow if the\npreceeding discriminant was `U64_MAX`. The logic in `rustc::middle::ty`\nfor this was altered to avoid the overflow completely, while the\nremaining places were changed to use wrapping methods. This is because\n`rustc::middle::ty::enum_variants` now throws an error when the\ncalculated discriminant value overflows a `u64`.\n\nThis behaviour can be triggered by the following code:\n\n```\nenum Foo {\n  A = U64_MAX,\n  B\n}\n```\n\nThis commit also implements the remaining integer operators for\nWrapped<T>.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/39ea4cce3962416543bca0c3b8ddcd5d097fea2d"},{"sha":"0872f8779673c9ab6a185df71e775827a85af2b6","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"MERGE add license to wrapping.rs","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/0872f8779673c9ab6a185df71e775827a85af2b6"},{"sha":"acb91331530804931aff598990dbd2df63d1a043","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"MERGE fix span_err call in ty.rs","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/acb91331530804931aff598990dbd2df63d1a043"},{"sha":"3d50c5e005fb37f6cb6fc9cc25acfc44c2ef78b0","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"MERGE remove accidental addition of an old debugging_opts macro.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/3d50c5e005fb37f6cb6fc9cc25acfc44c2ef78b0"},{"sha":"a67a6c7717f61b98a36e0a6aaf783cbba235c86a","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"MERGE fix to how we match target_pointer_width in trans/expr.rs","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/a67a6c7717f61b98a36e0a6aaf783cbba235c86a"},{"sha":"e0aff1f09be1e0ae029cb184b450e2024da2bfea","author":{"email":"474ba67bdb289c6263b36dfd8a7bed6c85b04943@aatch.net","name":"James Miller"},"message":"Implement parse_opt_bool better\n\nDuring my clean-up of rebase errors, I took the opportunity to implement\nparse_opt_bool so that it isn't identical to parse_bool wrapped in\n`Some`.\n\nparse_opt_bool considers no value to be true, a value of 'y', 'yes' or\n'on' to be true and 'n', 'no' or 'off' to be false. All other values are\nan error.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/e0aff1f09be1e0ae029cb184b450e2024da2bfea"},{"sha":"adc8f53738ad0bbb9aaebf7a1df4456fe99be3d0","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"fix experimental-attribute on `mod wrapping` to be `unstable` instead.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/adc8f53738ad0bbb9aaebf7a1df4456fe99be3d0"},{"sha":"81a991d33c2fba777c56601101ea6a2d618bb796","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"fix Iter::rposition for new arith-overflow checking.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/81a991d33c2fba777c56601101ea6a2d618bb796"},{"sha":"447e868fa6f09c5e9d1d089b883399874e3732db","author":{"email":"4cc33a8ae3d9bb448f90bf63a1d4018698b1fb94@alum.mit.edu","name":"Niko Matsakis"},"message":"fix test generic-extern-mangle.rs","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/447e868fa6f09c5e9d1d089b883399874e3732db"},{"sha":"03cd675a197aa84ca1329b42ab68b62d60fcafe1","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Fixes to collections::ring_buf to accommodate arith-overflow changes.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/03cd675a197aa84ca1329b42ab68b62d60fcafe1"},{"sha":"42476a06b816d1df553121df20b23c11fc7f8740","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Added `OverflowingOps` trait to core::num::wrapping.\n\nThese return the result of the operation *plus* an overflow/underflow bit.\n\nThis can make it easier to write operations where you want to chain\nsome arithmetic together, but also want to return a flag signalling if\noverflow every occurred.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/42476a06b816d1df553121df20b23c11fc7f8740"},{"sha":"87cf8d06963368a96c1123e7edce2d2c724eaa21","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Fix the overflowing tests in run-fail.\n\n* The error patterns had a typo.\n\n* Our current constant evaluation would silently allow the overflow\n  (filed as Issue 22531).\n\n* The overflowing-mul test was accidentally doing addition instead of\n  multiplication.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/87cf8d06963368a96c1123e7edce2d2c724eaa21"},{"sha":"6ab7a3e477ce97e32fe87a269af340627f451fc3","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Make `test/run-pass/backtrace.rs` more robust about own host environment.\n\nNamely, I have been annoyed in the past when I have done\n`RUST_BACKTRACE=1 make check` only to discover (again) that such a\ntrick causes this test to fail, because it assumes that the\n`RUST_BACKTRACE` environment variable is not set.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/6ab7a3e477ce97e32fe87a269af340627f451fc3"},{"sha":"d2e042a7d9fe248fa5f99f0311684c058ac578b1","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Use `OverflowingOps` trait in hash/table.rs to track overflow.\n\nUse the newly added `OverflowingOps` trait to track whether overflow\noccurs during the `calculate_offsets` and `calculate_allocation`\nfunctions.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/d2e042a7d9fe248fa5f99f0311684c058ac578b1"},{"sha":"61e8173f585e65bb666d1d753f1aabf92f4026c2","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Address arith-overflow changes in librand/distributions/range.rs","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/61e8173f585e65bb666d1d753f1aabf92f4026c2"},{"sha":"7da5d5828fff9af130cc66ee261933ff6caed7b9","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Accommodate arith-overflow in `UnsignedInt::{is_power_of_two, next_power_of_two}`","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/7da5d5828fff9af130cc66ee261933ff6caed7b9"},{"sha":"d0246c37c00679166a55339dade4a811306a4f5d","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Accommodate arith-overflow in `uint::test_uint_{to,from}_str_overflow`.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/d0246c37c00679166a55339dade4a811306a4f5d"},{"sha":"7c3a6da32075785a0fe925a497eaed4a5da105f8","author":{"email":"8de0203a6391036bc81ce266eefac1291b6bcb9a@pnkfx.org","name":"Felix S. Klock II"},"message":"Fixes for arith-overflow checking to std::num::strconv tests.","distinct":true,"url":"https://api.github.com/repos/pnkfelix/rust/commits/7c3a6da32075785a0fe925a497eaed4a5da105f8"}]}