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

SendInLoop Interprocedural Improvement #219

Merged

Conversation

Esorat
Copy link
Member

@Esorat Esorat commented Nov 18, 2024

Closes #174

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented
  • No test failures were reported when running yarn test-all
  • I did not do unrelated and/or undiscussed refactorings

src/detectors/builtin/sendInLoop.ts Outdated Show resolved Hide resolved
src/detectors/builtin/sendInLoop.ts Outdated Show resolved Hide resolved
src/detectors/builtin/sendInLoop.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
Copy link
Member

@jubnzv jubnzv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a problem in the callgraph builder. We have name collisions for methods and free functions:

fun test() {}
contract C {
  fun test() { test() }
}

Generates the following CG:

изображение

Thus, we need to fix it first, and then use the updated getFunctionName function in this lint.

src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/detectors/builtin/sendInLoop.ts Show resolved Hide resolved
src/detectors/builtin/sendInLoop.ts Outdated Show resolved Hide resolved
@jubnzv
Copy link
Member

jubnzv commented Nov 20, 2024

We also need to update internals/ir/index.ts:

export * from "./callgraph";

src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
Fix: callgraph id
Chore: add comments to Flag const for CGnode
@jubnzv jubnzv merged commit 94337d2 into nowarp:master Nov 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SendInLoop: Interprocedural Improvement
2 participants