Skip to content

Commit 2afe3d9

Browse files
kevinabrson
authored andcommitted
---
yaml --- r: 7717 b: refs/heads/snap-stage3 c: 1625a43 h: refs/heads/master i: 7715: d52d81e v: v3
1 parent 226b658 commit 2afe3d9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 93e9600a94ab516b090a8e90233ec0694a9b3b23
4+
refs/heads/snap-stage3: 1625a4320d80d65814dbbef2a593ba340163bc9c
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/comp/syntax/codemap.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ type lookup_fn = fn@(file_pos) -> uint;
3434

3535
fn lookup_pos(map: codemap, pos: uint, lookup: lookup_fn) -> loc {
3636
let len = vec::len(map.files);
37-
if len > 1u && map.files[len - 1u].name == "-" {
38-
// the trailing "-" must be the core_macros inserted by expand_crate,
39-
// exclude it from the targets to lookup
40-
len = len - 1u;
41-
}
4237
let a = 0u;
4338
let b = len;
4439
while b - a > 1u {
4540
let m = (a + b) / 2u;
4641
if lookup(map.files[m].start_pos) > pos { b = m; } else { a = m; }
4742
}
43+
if (a >= len) {
44+
ret { filename: "-", line: 0u, col: 0u };
45+
}
4846
let f = map.files[a];
4947
a = 0u;
5048
b = vec::len(f.lines);

0 commit comments

Comments
 (0)