Skip to content

Commit 6258b5f

Browse files
committed
[BitcodeReader] Use poison instead of undef for invalid instructions
1 parent 824113f commit 6258b5f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,7 @@ Error BitcodeReader::parseConstants() {
32283228
V = ConstantFP::get(
32293229
CurTy, APFloat(APFloat::PPCDoubleDouble(), APInt(128, Record)));
32303230
else
3231-
V = UndefValue::get(CurTy);
3231+
V = PoisonValue::get(CurTy);
32323232
break;
32333233
}
32343234

@@ -3251,7 +3251,7 @@ Error BitcodeReader::parseConstants() {
32513251
V = BitcodeConstant::create(
32523252
Alloc, CurTy, BitcodeConstant::ConstantVectorOpcode, Elts);
32533253
} else {
3254-
V = UndefValue::get(CurTy);
3254+
V = PoisonValue::get(CurTy);
32553255
}
32563256
break;
32573257
}
@@ -3332,7 +3332,7 @@ Error BitcodeReader::parseConstants() {
33323332
return error("Invalid unary op constexpr record");
33333333
int Opc = getDecodedUnaryOpcode(Record[0], CurTy);
33343334
if (Opc < 0) {
3335-
V = UndefValue::get(CurTy); // Unknown unop.
3335+
V = PoisonValue::get(CurTy); // Unknown unop.
33363336
} else {
33373337
V = BitcodeConstant::create(Alloc, CurTy, Opc, (unsigned)Record[1]);
33383338
}
@@ -3343,7 +3343,7 @@ Error BitcodeReader::parseConstants() {
33433343
return error("Invalid binary op constexpr record");
33443344
int Opc = getDecodedBinaryOpcode(Record[0], CurTy);
33453345
if (Opc < 0) {
3346-
V = UndefValue::get(CurTy); // Unknown binop.
3346+
V = PoisonValue::get(CurTy); // Unknown binop.
33473347
} else {
33483348
uint8_t Flags = 0;
33493349
if (Record.size() >= 4) {
@@ -3373,7 +3373,7 @@ Error BitcodeReader::parseConstants() {
33733373
return error("Invalid cast constexpr record");
33743374
int Opc = getDecodedCastOpcode(Record[0]);
33753375
if (Opc < 0) {
3376-
V = UndefValue::get(CurTy); // Unknown cast.
3376+
V = PoisonValue::get(CurTy); // Unknown cast.
33773377
} else {
33783378
unsigned OpTyID = Record[1];
33793379
Type *OpTy = getTypeByID(OpTyID);

0 commit comments

Comments
 (0)