Skip to content

Commit 975c05b

Browse files
committed
[Bitcode] Check for missing load type
We perform do this check independently of whether this is an old or new style load. Fixes #74556.
1 parent 84e0145 commit 975c05b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5968,10 +5968,11 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
59685968
} else {
59695969
ResTypeID = getContainedTypeID(OpTypeID);
59705970
Ty = getTypeByID(ResTypeID);
5971-
if (!Ty)
5972-
return error("Missing element type for old-style load");
59735971
}
59745972

5973+
if (!Ty)
5974+
return error("Missing load type");
5975+
59755976
if (Error Err = typeCheckLoadStoreInst(Ty, Op->getType()))
59765977
return Err;
59775978

@@ -6006,10 +6007,11 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
60066007
} else {
60076008
ResTypeID = getContainedTypeID(OpTypeID);
60086009
Ty = getTypeByID(ResTypeID);
6009-
if (!Ty)
6010-
return error("Missing element type for old style atomic load");
60116010
}
60126011

6012+
if (!Ty)
6013+
return error("Missing atomic load type");
6014+
60136015
if (Error Err = typeCheckLoadStoreInst(Ty, Op->getType()))
60146016
return Err;
60156017

0 commit comments

Comments
 (0)