Skip to content

fix: fix init-reassign for-loop bug - #466

Merged
rkalis merged 2 commits into
nextfrom
claude/cashscript-audit-findings-19862f
Sep 29, 2026
Merged

rkalis merged 2 commits into
nextfrom
claude/cashscript-audit-findings-19862f

Conversation

@rkalis

@rkalis rkalis commented Sep 29, 2026

Copy link
Copy Markdown
Member

No description provided.

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cashscript Ready Ready Preview Sep 29, 2026 9:30am UTC

Request Review

@rkalis
rkalis merged commit 4f157e2 into next Sep 29, 2026
1 of 3 checks passed
@rkalis
rkalis deleted the claude/cashscript-audit-findings-19862f branch September 29, 2026 09:30
mr-zwets added a commit that referenced this pull request Sep 29, 2026
- Use the default value for compiler options that are passed as undefined
  (e.g. `{ enforceLocktimeGuard: config.x }` with `x` unset), which disabled
  the locktime guard or parameter type checks, and only record the known
  options in the artifact (unknown keys and the `files` map were copied in).
- Make the old stack slot of a variable anonymous when it is reassigned
  outside of a loop or branch, so a mismatch between where the symbol table
  records a final use and where code generation reads the variable (like
  the ones fixed in #464 and #466) is a compile error instead of reading an
  outdated value. This does not change any bytecode, and makes console.log
  show the current value of a reassigned variable after its final use.
- Declare new tuple destructuring targets after visiting the right-hand side,
  so using one of them there is an UndefinedReferenceError instead of an
  internal error.

Adds a test that no variable is read after its final use, for every valid
contract file and for a contract that reads the same variable in every
child of each expression node type.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 54013bf2 Deployed Sep 29, 2026 by vercel[bot]
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.

1 participant