Skip to content

Commit

Permalink
Merge branch 'master' into get-operand-bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDan64 authored Sep 19, 2024
2 parents bfb1773 + 885c5f7 commit d12f5d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/basic_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl<'ctx> BasicBlock<'ctx> {
{
use llvm_sys::core::LLVMSetValueName2;

unsafe { LLVMSetValueName2(LLVMBasicBlockAsValue(self.basic_block), c_string.as_ptr(), name.len()) };
unsafe { LLVMSetValueName2(LLVMBasicBlockAsValue(self.basic_block), c_string.as_ptr(), c_string.to_bytes().len()) };
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl ContextImpl {
fn metadata_string<'ctx>(&self, string: &str) -> MetadataValue<'ctx> {
let c_string = to_c_str(string);

unsafe { MetadataValue::new(LLVMMDStringInContext(self.0, c_string.as_ptr(), string.len() as u32)) }
unsafe { MetadataValue::new(LLVMMDStringInContext(self.0, c_string.as_ptr(), c_string.to_bytes().len() as u32)) }
}

fn get_kind_id(&self, key: &str) -> u32 {
Expand Down
2 changes: 1 addition & 1 deletion src/values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl<'ctx> Value<'ctx> {
{
use llvm_sys::core::LLVMSetValueName2;

unsafe { LLVMSetValueName2(self.value, c_string.as_ptr(), name.len()) }
unsafe { LLVMSetValueName2(self.value, c_string.as_ptr(), c_string.to_bytes().len()) }
}
}

Expand Down

0 comments on commit d12f5d5

Please sign in to comment.