-
Notifications
You must be signed in to change notification settings - Fork 1
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
Using argot:ignore annotations in the taint analysis. #101
Conversation
analysis/dataflow/state.go
Outdated
@@ -120,10 +121,20 @@ func NewAnalyzerState(p *ssa.Program, pkgs []*packages.Package, l *config.LogGro | |||
steps []func(*AnalyzerState)) (*AnalyzerState, error) { | |||
var allContracts []Contract | |||
|
|||
// Load annotations | |||
// Load annotations byt scanning all package's syntax |
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.
nit: typos
for _, pkg := range pkgs { | ||
analysisutil.VisitPackages(pkg, func(p *packages.Package) bool { | ||
// Don't scan stdlib for annotations! | ||
if summaries.IsStdPackageName(p.Name) { |
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.
Should we also avoid scanning dependencies? Not sure how to identify them though
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.
I'll leave a TODO and make an issue. Based on demand we can figure out how to implement it, but early on it's unlikely the dependencies will have annotations, and scanning is relatively fast compared to all the other analysis steps.
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.
Issue #102 for tracking this.
9450072
to
24b590c
Compare
Annotating a line with
//argot:ignore
supresses findings on that line for the taint analysis.See
analysis/taint/testdata/annotations/main.go
for an example.