Skip to content

Commit 1c1af99

Browse files
committed
Fix symbol mangling in the presence of trailing version numbers.
1 parent 79ed1f2 commit 1c1af99

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rustc/back/link.rs

+8
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,14 @@ fn sanitize(s: str) -> str {
466466
}
467467
}
468468
}
469+
470+
// Underscore-qualify anything that didn't start as an ident.
471+
if result.len() > 0u &&
472+
result[0] != '_' as u8 &&
473+
! char::is_XID_start(result[0] as char) {
474+
ret "_" + result;
475+
}
476+
469477
ret result;
470478
}
471479

0 commit comments

Comments
 (0)