Skip to content

Fix compound indexed assignment evaluation - #3056

Open
dajiaohuang wants to merge 1 commit into
AssemblyScript:mainfrom
dajiaohuang:fix/issue-3051-compound-indexed-assignment
Open

dajiaohuang wants to merge 1 commit into
AssemblyScript:mainfrom
dajiaohuang:fix/issue-3051-compound-indexed-assignment

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #3051.

Changes proposed in this pull request:

  • Preserve the receiver and index of compound indexed assignments so expressions with side effects are evaluated once.
  • Store the assigned value before invoking an overloaded indexed setter, and preserve the compound assignment expression's result.
  • Add regression coverage for StaticArray indexed compound assignment, side effects, stored value, and expression result.

Validation: npm run check passed; npm run build passed; focused compiler regression passed in debug and release, including fixture comparison and instantiation; resolve-elementaccess fixture tests passed after regeneration. The full npm test -- --noColors command reached the asconfig suite but stopped because a nested Windows command could not resolve npm; compiler-suite tests before that stage succeeded. No CI or review result is claimed.

AI assistance was used for investigation and implementation; I reviewed and validated the submitted changes.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"+=" for an operand with side effects causes miscompilation

1 participant