mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
Rollup merge of #78462 - danielframpton:fixnullisa, r=nagisa
Use unwrapDIPtr because the Scope may be null. I ran into an assertion when using debug information on Windows with LLVM assertions enabled. It seems like we are using unwrap here (which in turn calls isa and requires the pointer to be non-null) but we expect the value to be null because that is what we are passing from rustc. This change uses unwrapDIPtr which explicitly allows nullptr. The FFI prototype for this method on the rust side has the `LLVMMetadataRef` parameter as `Scope: Option<&'a DIScope>`, and we always pass `None` when `msvc_like_names` is true.
This commit is contained in:
commit
38c34098b1
@ -766,7 +766,7 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateTypedef(
|
||||
LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Scope) {
|
||||
return wrap(Builder->createTypedef(
|
||||
unwrap<DIType>(Type), StringRef(Name, NameLen), unwrap<DIFile>(File),
|
||||
LineNo, unwrap<DIScope>(Scope)));
|
||||
LineNo, unwrapDIPtr<DIScope>(Scope)));
|
||||
}
|
||||
|
||||
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreatePointerType(
|
||||
|
Loading…
Reference in New Issue
Block a user