Skip to content

Commit

Permalink
Fix symbol mangling in the presence of trailing version numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed May 2, 2012
1 parent 79ed1f2 commit 1c1af99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ fn sanitize(s: str) -> str {
}
}
}

// Underscore-qualify anything that didn't start as an ident.
if result.len() > 0u &&
result[0] != '_' as u8 &&
! char::is_XID_start(result[0] as char) {
ret "_" + result;
}

ret result;
}

Expand Down

0 comments on commit 1c1af99

Please sign in to comment.