Repository navigation
bugc: combine thirteen fixes and additions - #368
Merged
Merged
Conversation
A storage write took its value as a word, so a memory string or bytes reference wrote its memory address into the slot. Code generation now encodes the referenced bytes as Solidity does: inline with length * 2 up to 31 bytes, else length * 2 + 1 in the slot and the data from keccak256(slot), with the last word's trailing bytes cleared. A slice now carries the bytes type, so its value is recognized too.
irgen built a slice's data as a read and a write, and a read or write moves at most one word, so only the first 32 bytes were copied. Add a copy IR instruction (CALLDATACOPY from calldata, MCOPY from memory) and emit it for the slice's data.
Contributor
|
This was referenced Oct 7, 2026
This was referenced Oct 7, 2026
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.
This combines thirteen bugc fixes and additions, each already open and reviewed as its own pull request, into one change so they land together. The individual pull requests stay as the record of each change and will be closed in favour of this one.
Fixes:
!as a logical not #353 compile!as a logical not (it compiled to a bitwise NOT)bytesNread the value as a memory address)keccak256hashed the pointer word); builds on bugc: hash several value-type words with keccak256 #365's list of hashed valuesAdditions:
block.prevrandaokeccak256(a, b, …)over value-type words, equal to Solidity'skeccak256(abi.encode(a, b, …))pushon dynamic storage arrays; indexing at or past the length reverts with Panic(0x32)Each pull request's changelog entry is kept as written.