diff options
| author | Andrea Canciani <ranma42@gmail.com> | 2016-04-14 13:02:47 +0200 |
|---|---|---|
| committer | Andrea Canciani <ranma42@gmail.com> | 2016-04-19 17:48:51 +0200 |
| commit | 5879ee1ecaa5738d93613c7bd14bdd09ab48450d (patch) | |
| tree | 0bf2ac8255b4e938cd7bfd444fa6aa1a938b85d7 | |
| parent | f942c28900159152358dd2f5718262464c09dc52 (diff) | |
| download | rust-5879ee1ecaa5738d93613c7bd14bdd09ab48450d.tar.gz rust-5879ee1ecaa5738d93613c7bd14bdd09ab48450d.zip | |
Distinguish different `vfp?` features
The different generations of ARM floating point VFP correspond to the LLVM CPU features named `vfp2`, `vfp3`, and `vfp4`; they are now exposed in Rust under the same names. This commit fixes some crashes that would occour when checking if the `vfp` feature exists (the crash occurs because the linear scan of the LLVM feature goes past the end of the features whenever it searches for a feature that does not exist in the LLVM tables).
| -rw-r--r-- | src/librustc_driver/target_features.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc_driver/target_features.rs b/src/librustc_driver/target_features.rs index 7f4375e993d..73b2b85a352 100644 --- a/src/librustc_driver/target_features.rs +++ b/src/librustc_driver/target_features.rs @@ -24,9 +24,15 @@ use libc::c_char; pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) { let target_machine = create_target_machine(sess); + // WARNING: the features must be known to LLVM or the feature + // detection code will walk past the end of the feature array, + // leading to crashes. + let arm_whitelist = [ "neon\0", - "vfp\0", + "vfp2\0", + "vfp3\0", + "vfp4\0", ]; let x86_whitelist = [ |
