C++: Make 'getChildCount' more robust by counting indexes instead of 'TranslatedDeclarationEntry's.

This commit is contained in:
Mathias Vorreiter Pedersen
2026-02-05 20:23:45 +00:00
parent 5adc9f8ff0
commit d57a42a7f7

View File

@@ -390,7 +390,7 @@ class TranslatedDeclStmt extends TranslatedStmt {
override TranslatedElement getLastChild() { result = this.getChild(this.getChildCount() - 1) }
private int getChildCount() { result = count(this.getDeclarationEntry(_)) }
private int getChildCount() { result = count(int i | exists(this.getDeclarationEntry(i))) }
IRDeclarationEntry getIRDeclarationEntry(int index) {
result.hasIndex(index) and