Skip to content

JS: Use shared SSA library - #22937

Draft
owen-mc wants to merge 3 commits into
github:mainfrom
owen-mc:experiments/js-shared-ssa
Draft

owen-mc wants to merge 3 commits into
github:mainfrom
owen-mc:experiments/js-shared-ssa

Conversation

@owen-mc

@owen-mc owen-mc commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

JavaScript and TypeScript data flow now use the shared SSA implementation, including refinements and conservative captured-variable definitions. The existing public SSA APIs remain available as shared-backed adapters; the separate JavaScript SSA computation has been removed. This improves barrier-guard handling at control-flow joins, reducing false positives when guarded and overwritten values merge, and improves the ordering of post-update flow around calls and assignments.

@owen-mc owen-mc added the JS label Oct 29, 2026
Comment thread javascript/ql/lib/semmle/javascript/SSA.qll Fixed
Comment thread javascript/ql/lib/semmle/javascript/SSA.qll Fixed
* statements so their reflective uncertainty does not propagate to later reads.
* Security flow must instead visit those reads so their barriers remain effective.
*/
predicate localFlowStepForTypeInference(EarlyStageNode pred, EarlyStageNode succ) {
owen-mc and others added 3 commits October 29, 2026 15:18
Add all migration regressions before changing the implementation. Mark main's known missing and spurious results inline, and record its current consistency-query output.

Use the existing internal node names and compare public/native definition coordinates so these tests compile before the migration. The integration commit switches the representation-specific checks to native shared definitions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add opt-in phi-definition retention for JavaScript's public SSA node API. Follow value-preserving uncertain definitions when determining guarded phi inputs.

Keep phi retention disabled by default for existing clients.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use shared SSA for definitions, refinements, captures, and local/global data flow. Remove JavaScript's separate liveness, phi insertion, and reaching-definition computation while preserving its public SSA APIs as shared-backed adapters.

Keep global continuing-value reads distinct from expression occurrences, preserve captured-variable and legacy Configuration guard behavior, and restrict reflective with-read shortcuts to type inference.

Propagate post-updates after operation completion and preserve updates across value-preserving reassignments using the existing modeled may-value flow.

Update test expectations and the change note. Keep known baseline clone and short-circuit false positives marked SPURIOUS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@owen-mc
owen-mc force-pushed the experiments/js-shared-ssa branch from d8a3801 to fda35fc Compare October 29, 2026 16:04

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants