File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,10 +436,10 @@ newtype TPosition =
436436 }
437437
438438private newtype TReturnKind =
439- TNormalReturnKind ( int index ) {
439+ TNormalReturnKind ( int indirectionIndex ) {
440440 exists ( IndirectReturnNode return |
441441 return .isNormalReturn ( ) and
442- index = return .getIndirectionIndex ( ) - 1 // We subtract one because the return loads the value.
442+ indirectionIndex = return .getIndirectionIndex ( ) - 1 // We subtract one because the return loads the value.
443443 )
444444 } or
445445 TIndirectReturnKind ( int argumentIndex , int indirectionIndex ) {
@@ -458,16 +458,22 @@ class ReturnKind extends TReturnKind {
458458 abstract string toString ( ) ;
459459}
460460
461+ /**
462+ * A value returned from a callable using a `return` statement, that is, a "normal" return.
463+ */
461464class NormalReturnKind extends ReturnKind , TNormalReturnKind {
462- int index ;
465+ int indirectionIndex ;
463466
464- NormalReturnKind ( ) { this = TNormalReturnKind ( index ) }
467+ NormalReturnKind ( ) { this = TNormalReturnKind ( indirectionIndex ) }
465468
466- int getIndirectionIndex ( ) { result = index }
469+ int getIndirectionIndex ( ) { result = indirectionIndex }
467470
468471 override string toString ( ) { result = "indirect return" }
469472}
470473
474+ /**
475+ * A value returned from a callable through a parameter.
476+ */
471477private class IndirectReturnKind extends ReturnKind , TIndirectReturnKind {
472478 int argumentIndex ;
473479 int indirectionIndex ;
You can’t perform that action at this time.
0 commit comments