-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Description
As an example,
extern mod extra;
use extra::bigint;
use extra::bigint::BigInt;
use extra::bigint::FromStr;
fn main() {
let a:bigint::BigInt = FromStr::from_str("31").unwrap();
let b:bigint::BigInt = FromStr::from_str("999999999999999999999999999999999999").unwrap();
let c = (a+b).to_str();
println(format!("{:?}",c));
}
will fail with
task '<main>' failed at 'vector size is too large: 18446744073709551615', /build/rust-git/src/rust/src/libstd/vec.rs:191
bigint needs to be carefully combed for overflow-correctness.
There is a test that makes sure this fails rather than segfaults in src/test/run-pass/bigint-overflow-segfault.rs
that will need to be updated.
Metadata
Metadata
Assignees
Labels
No labels