Skip to content

Conversation

@aschackmull
Copy link
Contributor

This replaces the two predicates, ssaDefAssigns and ssaDefInitializesParam, with a per-default synthesized input-value node that can then be mapped to the RHS of an assignment or the parameter as appropriate.

The changes are split into individual commits that can be reviewed one-by-one, but the combined changes are simple enough that it's possibly just as easy to just look at all the changes together.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Mar 28, 2025
Copilot AI review requested due to automatic review settings March 28, 2025 11:10
@aschackmull aschackmull requested review from a team as code owners March 28, 2025 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (11)
  • cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll: Language not supported
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll: Language not supported
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImpl.qll: Language not supported
  • java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll: Language not supported
  • java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/dataflow/internal/sharedlib/Ssa.qll: Language not supported
  • ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll: Language not supported
  • ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll: Language not supported
  • rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll: Language not supported
  • rust/ql/lib/codeql/rust/dataflow/internal/SsaImpl.qll: Language not supported
  • shared/ssa/codeql/ssa/Ssa.qll: Language not supported

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@github-actions github-actions bot added C# JS C++ Java Ruby Rust Pull requests that update Rust code labels Mar 28, 2025
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

LGTM, two minor comments.

WriteDefinition getDefinition() { result = def }

override string toString() { result = p.toString() }
override string toString() { result = def.toString() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps add a [source] prefix or suffix to make it easier to debug?

}

predicate ssaDefInitializesParam(WriteDefinition def, Parameter p) { p.isInitializedBy(def) }

Copy link
Contributor

Choose a reason for hiding this comment

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

Should ssaDefHasSource be implemented, restricting to any(Parameter p).isInitializedBy(def) or def.(Ssa::WriteDefinition).assigns(_)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Optionally, yes. It makes no semantic difference, it only causes a slight reduction in generated nodes (nodes that are of course unreachable by any step). I figured that such a restriction was likely most of the write definitions, which is why I didn't bother originally, but I just checked, and there is a noticeable count difference, so I'll add it.

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Remember DCA before merging.

@aschackmull aschackmull merged commit a8b19d2 into github:main Mar 31, 2025
59 checks passed
@aschackmull aschackmull deleted the ssa/writedef-source-refactor branch March 31, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# C++ Java JS no-change-note-required This PR does not need a change note Ruby Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants