Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c1f433

Browse files
committed
C++: Move getIndirectionIndex to ReturnKind.
1 parent 963e0a7 commit 4c1f433

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ private newtype TReturnKind =
454454
* from a callable. For C++, this is simply a function return.
455455
*/
456456
class ReturnKind extends TReturnKind {
457+
/**
458+
* Gets the indirection index of this return kind.
459+
*/
460+
abstract int getIndirectionIndex();
461+
457462
/** Gets a textual representation of this return kind. */
458463
abstract string toString();
459464
}
@@ -466,7 +471,7 @@ class NormalReturnKind extends ReturnKind, TNormalReturnKind {
466471

467472
NormalReturnKind() { this = TNormalReturnKind(indirectionIndex) }
468473

469-
int getIndirectionIndex() { result = indirectionIndex }
474+
override int getIndirectionIndex() { result = indirectionIndex }
470475

471476
override string toString() { result = "indirect return" }
472477
}
@@ -480,6 +485,8 @@ private class IndirectReturnKind extends ReturnKind, TIndirectReturnKind {
480485

481486
IndirectReturnKind() { this = TIndirectReturnKind(argumentIndex, indirectionIndex) }
482487

488+
override int getIndirectionIndex() { result = indirectionIndex }
489+
483490
override string toString() { result = "indirect outparam[" + argumentIndex.toString() + "]" }
484491
}
485492

0 commit comments

Comments
 (0)