rust/src/libstd
bors 84e22f2b8e auto merge of #6108 : gifnksm/rust/bigint-shift-bug, r=brson
`std::bigint` contains the following code.
```rust
borrow = *elem << (uint::bits - n_bits);
```
The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand,
because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture.

If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`,
but if --opt-level is given, `borrow` is always zero.

I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug,
but the unittest passes normally.)

This pull request also removes the implicit vector copies in `bigint.rs`.
2013-04-29 22:30:36 -07:00
..
num auto merge of #6108 : gifnksm/rust/bigint-shift-bug, r=brson 2013-04-29 22:30:36 -07:00
arc.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
arena.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
base64.rs make way for a new iter module 2013-04-28 22:31:39 -04:00
bitv.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
c_vec.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
cmp.rs
comm.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
dbg.rs librustc: Remove ptr::addr_of. 2013-04-29 14:30:53 -07:00
deque.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
dlist.rs make way for a new iter module 2013-04-28 22:31:39 -04:00
ebml.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
fileinput.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
flatpipes.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
fun_treemap.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
future.rs test: Fix more tests. 2013-04-29 14:30:57 -07:00
getopts.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
io_util.rs
json.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
list.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
md4.rs Removing no longer needed unsafe blocks 2013-04-08 17:50:25 -04:00
net_ip.rs libstd: Fix merge fallout. 2013-04-29 14:30:57 -07:00
net_tcp.rs librustc: Remove ptr::addr_of. 2013-04-29 14:30:53 -07:00
net_url.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
net.rs
par.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
priority_queue.rs libstd: Fix merge fallout. 2013-04-29 14:30:57 -07:00
rl.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
rope.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
semver.rs Removed ascii functions from other modules 2013-04-24 22:26:09 +02:00
serialize.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
sha1.rs std: remove unused 'mut' variables 2013-04-20 21:03:24 -04:00
smallintmap.rs make way for a new iter module 2013-04-28 22:31:39 -04:00
sort.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
stats.rs
std.rc only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
sync.rs test: Fix tests. 2013-04-29 14:30:56 -07:00
task_pool.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
tempfile.rs core: Use a better termination condition in os::mkdir_recursive 2013-04-28 21:25:35 -07:00
term.rs
test.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
time.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
timer.rs librustc: Remove ptr::addr_of. 2013-04-29 14:30:53 -07:00
treemap.rs only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
unicode.rs
uv_global_loop.rs librustc: Remove ptr::addr_of. 2013-04-29 14:30:53 -07:00
uv_iotask.rs librustc: Remove ptr::addr_of. 2013-04-29 14:30:53 -07:00
uv_ll.rs test: Fix tests. 2013-04-29 14:30:56 -07:00
uv.rs
workcache.rs librustc: Forbid type implementations on typedefs. 2013-04-29 14:30:57 -07:00