C++: Fix bug for single-instruction basic blocks.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-05-17 15:42:38 +01:00
parent 771abf4f97
commit 57cc316ecd

View File

@@ -271,8 +271,9 @@ private module Cached {
/** Holds if `i` is the `index`th instruction in `block`. */
cached
Instruction getInstruction(TIRBlock block, int index) {
exists(Instruction first |
block = MkIRBlock(first) and
exists(Instruction first | block = MkIRBlock(first) |
first = result and index = 0
or
index = getMemberIndex(result) and
BlockAdjacency::getEquivalenceClass(first) = BlockAdjacency::getEquivalenceClass(result)
)