about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-03 06:11:38 +0000
committerbors <bors@rust-lang.org>2014-07-03 06:11:38 +0000
commit00f9ff2b41ffd1f1c187533570d979018724852a (patch)
tree3213e9e5f8328493feb5bc417d55f2460f117c8b /src/libsyntax/parse/parser.rs
parente6c54a12c4d209de9f438b4722657ca381f969a2 (diff)
parentc0248c0839cfdf5b7030f4191ea7aed0981b9e4e (diff)
downloadrust-00f9ff2b41ffd1f1c187533570d979018724852a.tar.gz
rust-00f9ff2b41ffd1f1c187533570d979018724852a.zip
auto merge of #15324 : sneves/rust/master, r=alexcrichton
The current implementation of `rotate_left` and `rotate_right` are incorrect when the rotation amount is 0, or a multiple of the input's bitsize. When `n = 0`, the expression

    (self >> n) | (self << ($BITS - n))

results in a shift left by `$BITS` bits, which is undefined behavior (see https://github.com/rust-lang/rust/issues/10183), and currently results in a hardcoded `-1` value, instead of the original input value. Reducing `($BITS - n)` modulo `$BITS`, simplified to `(-n % $BITS)`, fixes this problem.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
0 files changed, 0 insertions, 0 deletions