Skip to content

C++: Use the new prototype-related extensionals in MaD#21899

Open
MathiasVP wants to merge 4 commits into
github:mainfrom
MathiasVP:use-new-prototype-extensionals
Open

C++: Use the new prototype-related extensionals in MaD#21899
MathiasVP wants to merge 4 commits into
github:mainfrom
MathiasVP:use-new-prototype-extensionals

Conversation

@MathiasVP
Copy link
Copy Markdown
Contributor

@MathiasVP MathiasVP commented May 27, 2026

This PR makes use of the new extensionals that were added in #21870 to fix a couple of bugs in MaD.

I discussed the best way to handle "backwards compatibility" with @jketema, and we agreed to keep the old code in production for a couple of versions to allow new databases with populated class_template_generated_from and function_template_generated_from extensionals to be produced.

The DCA run is up-to-date (and boring as expected). The force-push was just me fixing up QLDoc.

@github-actions github-actions Bot added the C++ label May 27, 2026
@MathiasVP MathiasVP force-pushed the use-new-prototype-extensionals branch from 357fd96 to 3002476 Compare May 28, 2026 09:16
@MathiasVP MathiasVP marked this pull request as ready for review May 28, 2026 10:03
@MathiasVP MathiasVP requested a review from a team as a code owner May 28, 2026 10:03
Copilot AI review requested due to automatic review settings May 28, 2026 10:03
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label May 28, 2026
Copy link
Copy Markdown
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.

Pull request overview

This PR updates the C++ MaD (Models as Data) support to leverage the newer template “prototype/origin” extensionals introduced in #21870, while retaining a fallback path for older databases whose upgrade leaves those extensionals empty.

Changes:

  • Add “new vs old” implementations for resolving fully-templated class/function entities, selecting based on whether the new extensionals are populated.
  • Adjust signature/type-name expansion to use the fully-templated declaring class resolution.
  • Update the MaD signatures test expectations to reflect the new resolution behavior.
Show a summary per file
File Description
cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll Switches MaD template-resolution logic to prefer new getOriginalTemplate-based extensionals with a compatibility fallback; minor QLDoc touch-ups.
cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected Updates expected signature/type-name output to match the new template-resolution behavior.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll Outdated
Comment thread cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll Outdated
@MathiasVP MathiasVP force-pushed the use-new-prototype-extensionals branch from 67d7281 to 2d58150 Compare May 28, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants