-
Notifications
You must be signed in to change notification settings - Fork 2
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
c improvements #82
c improvements #82
Conversation
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
f2.signature shouldBe "void A.f (char)" | ||
foo.fullName shouldBe "foo" | ||
bar.fullName shouldBe "bar" | ||
f1.fullName shouldBe "A.f:void(int)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example of the improvements.
cpg.method.fullName("Cat.eat").caller.fullName.toSet shouldBe Set("main") | ||
cpg.method.fullName("Animal.eat").caller.fullName.toSet shouldBe Set("People.feedPets", "main") | ||
cpg.method.name("eat").fullName.toSet shouldBe Set("Animal.eat:void()", "Cat.eat:void()", "People.eat:void()") | ||
cpg.method.name("main").callee.fullName.toSet shouldBe Set("Animal.eat:void()", "Cat.eat:void()", "<operator>.addressOf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a bug since Animal.eat
is never called from main. But this is for another day.
@@ -124,32 +124,32 @@ class AstCreationPassTests extends AbstractPassTest { | |||
inside(cpg.method.fullNameExact(lambda1FullName).l) { case List(l1) => | |||
l1.name shouldBe lambda1FullName | |||
l1.code should startWith("[] (int a, int b) -> int") | |||
l1.signature shouldBe "int anonymous_lambda_0 (int,int)" | |||
l1.signature shouldBe "int (int,int)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function and lambda names are removed from the signature.
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Brings numerous improvements to full names and signature from upstream.