diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/Declaration.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/Declaration.kt index 068c956eeb..14f32aa751 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/Declaration.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/Declaration.kt @@ -52,7 +52,7 @@ abstract class Declaration : Node() { * Each Declaration allocates new memory, AKA a new address, so we create a new MemoryAddress * node */ - lateinit var memoryAddress: MemoryAddress + open lateinit var memoryAddress: MemoryAddress fun memoryAddressIsInitialized() = ::memoryAddress.isInitialized } diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/PointsToPass.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/PointsToPass.kt index 050e1f84bc..86e8047370 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/PointsToPass.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/PointsToPass.kt @@ -271,7 +271,11 @@ class PointsToPass(ctx: TranslationContext) : EOGStarterPass(ctx, orderDependenc when (param) { is ParameterDeclaration -> // Dereference the parameter - doubleState.getValues(currentNode.arguments[param.argumentIndex]) + if (param.argumentIndex < currentNode.arguments.size) { + doubleState.getValues( + currentNode.arguments[param.argumentIndex] + ) + } else null else -> null } val sources = mutableSetOf() diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt index 1cf4fe3a36..4cff97c62b 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt @@ -410,7 +410,7 @@ open class SymbolResolver(ctx: TranslationContext) : ComponentPass(ctx) { } } - protected fun handleCallExpression(call: CallExpression) { + protected open fun handleCallExpression(call: CallExpression) { // Some local variables for easier smart casting val callee = call.callee val language = call.language