fuzzyc2cpg
fuzzyc2cpg copied to clipboard
Inheritance
The linker creates INHERITS_FROM edges here:
https://github.com/ShiftLeftSecurity/codepropertygraph/blob/10e16ba5d3cd9ed3896c70997fa9f0fd209b6f08/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/passes/linking/linker/Linker.scala#L84
This seems to not work for the fuzzy C frontend. I created a failing test to highlight the issue: https://github.com/ShiftLeftSecurity/codepropertygraph/compare/fabs/inher
My guess would be that INHERITS_FROM_TYPE_FULL_NAME is not set on TYPE_DECL nodes. You can look into java2cpg to see how it's done:
https://github.com/ShiftLeftSecurity/java2cpg/blob/3bdf268a2c0840e09ae27ea3b6f7011bfb75cada/java2cpg/src/main/java/io/shiftleft/java2cpg/domainlogic/structure/IClassStub.java#L66
Please also add a corresponding test in fuzzyc2cpg.
I updated your test branch (cf https://github.com/ShiftLeftSecurity/codepropertygraph/commit/7ddee61110b0888058dda450005f2ca5582618ef) to now work with https://github.com/ShiftLeftSecurity/fuzzyc2cpg/pull/137/commits/02b270218f11304784ea33c808febeba8dc3c64b
As you see in the updated test, we have a minor problem: Currently nobody guarantees that a TYPE node with matching full name is created for the Base classes.