Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[c2cpg] Fix missing type register call for implicit this access #5219

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t

private def syntheticThisAccess(ident: CPPASTIdExpression, identifierName: String): String | Ast = {
val tpe = ident.getName.getBinding match {
case f: CPPField => cleanType(f.getType.toString)
case f: CPPField => f.getType.toString
case _ => typeFor(ident)
}
Try(ident.getEvaluation).toOption match {
Expand All @@ -125,7 +125,8 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t
val code = s"this->$identifierName"
val thisIdentifier = identifierNode(ident, "this", "this", ownerType)
val member = fieldIdentifierNode(ident, identifierName, identifierName)
val ma = callNode(ident, code, op, op, DispatchTypes.STATIC_DISPATCH, None, Some(tpe))
val ma =
callNode(ident, code, op, op, DispatchTypes.STATIC_DISPATCH, None, Some(registerType(cleanType(tpe))))
callAst(ma, Seq(Ast(thisIdentifier).withRefEdge(thisIdentifier, variable), Ast(member)))
case None => tpe
}
Expand Down
Loading