Skip to content

Commit 8e1d9e0

Browse files
committed
C++: Fix bad join order introduced by #4270
1 parent 63afe1d commit 8e1d9e0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,11 @@ private predicate getFieldSizeOfClass(Class c, Type type, int size) {
562562
)
563563
}
564564

565-
private predicate isSingleFieldClass(Type type, Class cTo) {
566-
exists(int size |
567-
cTo.getSize() = size and
568-
getFieldSizeOfClass(cTo, type, size)
565+
private predicate isSingleFieldClass(Type type, Operand op) {
566+
exists(int size, Class c |
567+
c = op.getType().getUnderlyingType() and
568+
c.getSize() = size and
569+
getFieldSizeOfClass(c, type, size)
569570
)
570571
}
571572

@@ -601,7 +602,7 @@ private predicate simpleOperandLocalFlowStep(Instruction iFrom, Operand opTo) {
601602
exists(LoadInstruction load |
602603
load.getSourceValueOperand() = opTo and
603604
opTo.getAnyDef() = iFrom and
604-
isSingleFieldClass(iFrom.getResultType(), opTo.getType().getUnderlyingType())
605+
isSingleFieldClass(iFrom.getResultType(), opTo)
605606
)
606607
}
607608

0 commit comments

Comments
 (0)