mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Merge pull request #4290 from MathiasVP/mathiasvp/fix-join-order-in-single-field-flow
C++: Fix bad join order introduced by #4270
This commit is contained in:
@@ -562,10 +562,11 @@ private predicate getFieldSizeOfClass(Class c, Type type, int size) {
|
||||
)
|
||||
}
|
||||
|
||||
private predicate isSingleFieldClass(Type type, Class cTo) {
|
||||
exists(int size |
|
||||
cTo.getSize() = size and
|
||||
getFieldSizeOfClass(cTo, type, size)
|
||||
private predicate isSingleFieldClass(Type type, Operand op) {
|
||||
exists(int size, Class c |
|
||||
c = op.getType().getUnderlyingType() and
|
||||
c.getSize() = size and
|
||||
getFieldSizeOfClass(c, type, size)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -601,7 +602,7 @@ private predicate simpleOperandLocalFlowStep(Instruction iFrom, Operand opTo) {
|
||||
exists(LoadInstruction load |
|
||||
load.getSourceValueOperand() = opTo and
|
||||
opTo.getAnyDef() = iFrom and
|
||||
isSingleFieldClass(iFrom.getResultType(), opTo.getType().getUnderlyingType())
|
||||
isSingleFieldClass(iFrom.getResultType(), opTo)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user