Skip to content

Commit 500d2ba

Browse files
committed
[OMPIRBuilder] Fix use of uninitialized variable.
The code in OpenMPIRBuilder::getTargetEntryUniqueInfo calls ID.getDevice() even when getUniqueID has failed and ID is un-initialized. This caused a sanitizer fail for me in #145026. Fix it by giving a default value to ID. The value chosen is the same as used in OpenMPToLLVMIRTranslation.cpp.
1 parent aa24029 commit 500d2ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9846,7 +9846,7 @@ void OffloadEntriesInfoManager::getTargetRegionEntryFnName(
98469846
TargetRegionEntryInfo
98479847
OpenMPIRBuilder::getTargetEntryUniqueInfo(FileIdentifierInfoCallbackTy CallBack,
98489848
StringRef ParentName) {
9849-
sys::fs::UniqueID ID;
9849+
sys::fs::UniqueID ID(0xdeadf17e, 0);
98509850
auto FileIDInfo = CallBack();
98519851
uint64_t FileID = 0;
98529852
std::error_code EC = sys::fs::getUniqueID(std::get<0>(FileIDInfo), ID);

0 commit comments

Comments
 (0)