Skip to content

Commit 265a641

Browse files
committed
C++: Use the underlying type to check whether a type is a single-field struct.
1 parent d18dd5a commit 265a641

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ pragma[noinline]
557557
private predicate getFieldSizeOfClass(Class c, Type type, int size) {
558558
exists(Field f |
559559
f.getDeclaringType() = c and
560-
f.getType() = type and
560+
f.getUnderlyingType() = type and
561561
type.getSize() = size
562562
)
563563
}
@@ -601,7 +601,7 @@ private predicate simpleOperandLocalFlowStep(Instruction iFrom, Operand opTo) {
601601
exists(LoadInstruction load |
602602
load.getSourceValueOperand() = opTo and
603603
opTo.getAnyDef() = iFrom and
604-
isSingleFieldClass(iFrom.getResultType(), opTo.getType())
604+
isSingleFieldClass(iFrom.getResultType(), opTo.getType().getUnderlyingType())
605605
)
606606
}
607607

0 commit comments

Comments
 (0)