Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upInteger overflow compiling libcore with RUST_LOG=rustc::middle::dataflow #24412
Comments
arielb1
changed the title
Integer overflow in with RUST_LOG=rustc::middle::dataflow
Integer overflow compiling libcore with RUST_LOG=rustc::middle::dataflow
Apr 14, 2015
steveklabnik
added
the
I-ICE
label
Apr 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Can't reproduce with
|
This comment has been minimized.
This comment has been minimized.
|
Are you sure you used a build with active logging? You need to configure it with |
This comment has been minimized.
This comment has been minimized.
|
Sorry, good hint. I CAN reproduce the ICE. |
This comment has been minimized.
This comment has been minimized.
|
oh cool, this seems like it must be a bug either in the overflow-detection or in the dataflow code |
This comment has been minimized.
This comment has been minimized.
|
It seems as if the dataflow code is flawed, trying to shift a usize var by values >32bits. Shouldn't the and'ed mask be dataflow.rs:660
|
This comment has been minimized.
This comment has been minimized.
|
yeah, that's definitely a bug; if the code (that this is providing instrumentation for) is extracting a byte and then a bit from within it, then
If its extracting a 32-bit word and then a bit within that, then
(if the extraction really is word-size dependent, that seems like a recipe for trouble to me... better to just use |
This comment has been minimized.
This comment has been minimized.
brson
added
the
P-low
label
Dec 1, 2016
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis says it's fixed. |
brson
closed this
Dec 1, 2016
This comment has been minimized.
This comment has been minimized.
|
fn bit_str(bit: usize) -> String {
let byte = bit >> 3;
let lobits = 1 << (bit & 0b111); // <-- NB: b111
format!("[{}:{}-{:02x}]", bit, byte, lobits)
} |
arielb1 commentedApr 14, 2015
Gives this ICE