Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7d28bf1

Browse files
committedMar 21, 2025
Auto merge of rust-lang#138775 - oli-obk:perf-check, r=<try>
Avoid sending a non-null pointer for empty strings Another try at fixing the perf regression from rust-lang#138674 r? `@ghost`
2 parents 5d85a71 + 6f92951 commit 7d28bf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,10 @@ fn create_file<'ll>(
643643
builder,
644644
file_name.as_c_char_ptr(),
645645
file_name.len(),
646-
directory.as_c_char_ptr(),
646+
if directory.is_empty() { ptr::null() } else { directory.as_c_char_ptr() },
647647
directory.len(),
648648
hash_kind,
649-
hash_value.as_c_char_ptr(),
649+
if hash_value.is_empty() { ptr::null() } else { hash_value.as_c_char_ptr() },
650650
hash_value.len(),
651651
source.map_or(ptr::null(), |x| x.as_c_char_ptr()),
652652
source.map_or(0, |x| x.len()),

0 commit comments

Comments
 (0)
Failed to load comments.