File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
14
14
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
15
15
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
16
16
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17
- refs/heads/auto: cf34f9f9a9503ac8852f6ac7426388734eb867b5
17
+ refs/heads/auto: 196851c4c92cf850d28bed749ab8c3034c04b9e3
18
18
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
19
19
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
Original file line number Diff line number Diff line change @@ -2329,7 +2329,9 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
2329
2329
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
2330
2330
2331
2331
let start_def_id = ccx.tcx.lang_items.start_fn();
2332
- if start_def_id.crate != ast::local_crate {
2332
+ if start_def_id.crate == ast::local_crate {
2333
+ ccx.sess.bug(" start lang item is never in the local crate ")
2334
+ } else {
2333
2335
let start_fn_type = csearch::get_type(ccx.tcx,
2334
2336
start_def_id).ty;
2335
2337
trans_external_path(ccx, start_def_id, start_fn_type);
@@ -2346,7 +2348,8 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
2346
2348
let (start_fn, args) = if use_start_lang_item {
2347
2349
let start_def_id = ccx.tcx.lang_items.start_fn();
2348
2350
let start_fn = if start_def_id.crate == ast::local_crate {
2349
- get_item_val(ccx, start_def_id.node)
2351
+ ccx.sess.bug(" start lang item is never in the local \
2352
+ crate ")
2350
2353
} else {
2351
2354
let start_fn_type = csearch::get_type(ccx.tcx,
2352
2355
start_def_id).ty;
Original file line number Diff line number Diff line change @@ -675,6 +675,11 @@ pub fn mkdir_recursive(p: &Path, mode: c_int) -> bool {
675
675
/// Lists the contents of a directory
676
676
#[ allow( non_implicitly_copyable_typarams) ]
677
677
pub fn list_dir ( p : & Path ) -> ~[ ~str ] {
678
+ if p. components . is_empty ( ) {
679
+ // Not sure what the right behavior is here, but this
680
+ // prevents a bounds check failure later
681
+ return ~[ ] ;
682
+ }
678
683
unsafe {
679
684
#[ cfg( target_os = "linux" ) ]
680
685
#[ cfg( target_os = "android" ) ]
@@ -1596,6 +1601,12 @@ mod tests {
1596
1601
}
1597
1602
}
1598
1603
1604
+ #[test]
1605
+ fn list_dir_empty_path() {
1606
+ let dirs = os::list_dir(&Path(" "));
1607
+ assert!(dirs.is_empty());
1608
+ }
1609
+
1599
1610
#[test]
1600
1611
fn path_is_dir() {
1601
1612
assert!((os::path_is_dir(&Path(" . "))));
You can’t perform that action at this time.
0 commit comments