Do not intern NUL terminators
The C representation needed by LLVM requires strings to be NUL-terminated, but on the Rust side they should not contain unwanted NULs.
This commit is contained in:
parent
3fc5d2746e
commit
f942c28900
|
@ -49,7 +49,7 @@ pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
|
|||
let tf = InternedString::new("target_feature");
|
||||
for feat in whitelist {
|
||||
if unsafe { LLVMRustHasFeature(target_machine, feat.as_ptr() as *const c_char) } {
|
||||
cfg.push(attr::mk_name_value_item_str(tf.clone(), intern(feat)))
|
||||
cfg.push(attr::mk_name_value_item_str(tf.clone(), intern(&feat[..feat.len()-1])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue