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 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: cf34f9f9a9503ac8852f6ac7426388734eb867b5
4
+ refs/heads/snap-stage3: 196851c4c92cf850d28bed749ab8c3034c04b9e3
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
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