Skip to content

fix(javascript): invalidate values on nontrivial binding writes - #678

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-binding-writes-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-binding-writes-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

What changed

Record identifier binding writes from updates, destructuring assignments, and predeclared for-in/of targets. Static value recovery now marks those bindings ambiguous instead of retaining their original initializer as an exact value. Assignment-pattern traversal visits target values/default-left/rest positions, not object keys or member owners. Existing direct assignment handling is preserved.

Real application reproduction

On an owned main.mjs, the complete built public analyzeJavaScriptApplication workflow previously emitted 1 for a binding read after counter++ (native Node produces 2), and "old" after [assigned] = ["new"] (native produces "new"). After, neither modified binding has a falsely exact semantic-graph literal; an unrelated "stable" binding remains exact. This is conservative write invalidation, not flow-sensitive evaluation of the final state.

Verification

  • Six added write-form cases fail before; the key/member-owner control passes.
  • Focused dataflow, lexical-structure and graph tests: 52 passed.
  • npm run check, npm run check:fast, npm run build:cached passed.
  • Built public application/native Node comparison and git diff --check passed.

No schema or tool changes. Member-object mutation, source execution and precise loop outcomes remain outside this fix. Hopper/Ghidra were not exercised because no binary provider changes. AI assistance was used for investigation, implementation and verification.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approve: nontrivial binding writes (++/--, destructuring assignment, for-in/of) now conservatively invalidate to ambiguous via assignedPatternIdentifiers, with key/owner positions correctly excluded. 6 fail-before forms + control covered. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(javascript): invalidate values on nontrivial binding writes.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants