C++: Enforce uniqueness in 'getVariableSize'.

This commit is contained in:
Mathias Vorreiter Pedersen
2026-01-26 15:00:00 +00:00
parent 2bd4ccee45
commit 91752e5307

View File

@@ -62,11 +62,13 @@ private Class getRootType(FieldAccess fa) {
* unspecified type of `v` is a `ReferenceType`.
*/
private int getVariableSize(Variable v) {
exists(Type t |
t = v.getUnspecifiedType() and
not t instanceof ReferenceType and
result = t.getSize()
)
result =
unique(Type t |
t = v.getUnspecifiedType() and
not t instanceof ReferenceType
|
t.getSize()
)
}
/**