Conversation
- Fix LockingBytecodeNullData push opcodes for empty chunks and chunks of 128-255 bytes, which did not match the SDK's OP_RETURN encoding. Literal chunks are now pushed together with their push opcode, and literal chunks larger than 255 bytes are a compile error - Fix tuple reassignment bypassing bytes length narrowing, e.g. `x, bytes rest = y.split(5);` after `require(x.length == 20);` - Make hex literals with an odd number of digits a compile error - Remove the early return TODO in EnsureFinalRequireTraversal (tracked in #416 and #424) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odes
String literal chunks (e.g. `bytes('memo')`) are pushed together with their
push opcode like hex literals, and chunks with a known length (e.g. bytes20)
are preceded by a constant push opcode. The push opcode is only computed at
runtime for chunks with an unknown length. Chunks whose size is known to be
larger than 255 bytes are a compile error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
On behalf of Mathieu G. (mr-zwets), written by Claude Opus 5.5. Opened from the wrong branch by mistake (the name collided with the branch of #452), please ignore; replaced by a new PR. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened on behalf of Mathieu G. (mr-zwets), written by Claude Opus 5.5.
Fixes the remaining compiler findings from the 0.14 pre-release audit, apart from the time-unit items in #455. Two of them silently compiled to the wrong value.
Changes
forinit reassigning a variable:int i = 7; for (i = 0; i < 3; i++) {}leftiat 7 after the loop, because the init pushed a new stack slot that the loop's cleanup dropped. The init now replaces the value in place, in contracts and global functions.slice()with one variable in both arguments: the final use was recorded in the order start, end, but the code evaluates end first. The variable was rolled before its last read, sob.slice(v, v + 1)either failed to compile or, afterv = v + 1, computedslice(0, 2). The symbol table now uses the code generation order.console.logafter a variable's final use now shows its current value. No bytecode changes.LockingBytecodeNullData: a runtime chunk over 255 bytes lost its size's high byte (6a 4c 2c …for 300 bytes). The high byte is now checked to be zero, so such chunks make the contract fail (2 more bytes for runtime-sized chunks).OP_2DROP OP_DROP), the BitAuth script showed an opcode twice, anddebug()/send()rejected valid spends. The tags are now merged, and the rendering never repeats an opcode, which also covers existing artifacts.undefineddisabled its check, and unknown keys (andfiles) were stored in the artifact. Options now fall back to their defaults, and only known options are stored.bytes a, bytes b = a.split(1);crashed with an internal error; it is now anUndefinedReferenceError.Tests
forinit (contract and global function),slice()and NullData chunk sizes. Newfor_loop_reassign_init.cashandslice_same_variable.cashfixtures. A test that no variable is read after its final use, across all valid contract files. Compiler option tests and a tuple error fixture.console.logof a reassigned variable after its final use.Each of these tests fails on the current
next. Recompiling every contract in the repo only changeslocking_bytecode_nulldata_chunksand the two new fixtures.Merges cleanly with #457 and #458; with #455 and the SDK findings PR only the release notes need their lines combined.
yarn build,yarn test,yarn lintandyarn spellcheckpass.🤖 Generated with Claude Code