C++: Fix off-by-one error in getType on 'FinalGlobalValue' nodes and accept test changes.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-08-19 13:03:53 +02:00
parent 302d35bedc
commit 16508b1800
4 changed files with 7 additions and 5 deletions

View File

@@ -795,7 +795,7 @@ class FinalGlobalValue extends Node, TFinalGlobalValue {
override DataFlowType getType() {
exists(int indirectionIndex |
indirectionIndex = globalUse.getIndirectionIndex() and
result = getTypeImpl(globalUse.getUnderlyingType(), indirectionIndex - 1)
result = getTypeImpl(globalUse.getUnderlyingType(), indirectionIndex)
)
}