Skip to content

Commit

Permalink
fact-gen: occasional crash with invalid acces to shufflevector mask
Browse files Browse the repository at this point in the history
For whatever reason, sometimes the shufflevector mask isn't available
through operand #2 🤷
  • Loading branch information
adrianherrera authored and langston-barrett committed May 15, 2023
1 parent 1a64af9 commit b182252
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion FactGenerator/src/InstructionVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,12 @@ void InstructionVisitor::visitShuffleVectorInst(
writeInstrOperand(pred::shufflevector::first_vector, iref, SVI.getOperand(0));
writeInstrOperand(
pred::shufflevector::second_vector, iref, SVI.getOperand(1));
writeInstrOperand(pred::shufflevector::mask, iref, SVI.getOperand(2));
#if LLVM_VERSION_MAJOR > 10
const llvm::Constant *mask = SVI.getShuffleMaskForBitcode();
#else
const llvm::Constant *mask = SVI.getMask();
#endif
writeInstrOperand(pred::shufflevector::mask, iref, mask);
}

void InstructionVisitor::visitUnaryInstruction(
Expand Down

0 comments on commit b182252

Please sign in to comment.