Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix ICE when assigning calldata Struct with external function type member to storage variable. - #16764

#16764
Open
matheusaaguiar wants to merge 2 commits into
developargotorg/solidity:developfrom
fix-ice-copy-struct-function-type-member-copy-calldata-to-storageargotorg/solidity:fix-ice-copy-struct-function-type-member-copy-calldata-to-storageCopy head branch name to clipboard
Open

Fix ICE when assigning calldata Struct with external function type member to storage variable.#16764
matheusaaguiar wants to merge 2 commits into
developargotorg/solidity:developfrom
fix-ice-copy-struct-function-type-member-copy-calldata-to-storageargotorg/solidity:fix-ice-copy-struct-function-type-member-copy-calldata-to-storageCopy head branch name to clipboard

Conversation

@matheusaaguiar

Copy link
Copy Markdown
Contributor

fix #16717.

@matheusaaguiar
matheusaaguiar force-pushed the fix-ice-copy-struct-function-type-member-copy-calldata-to-storage branch from 03cb6af to 55d0c56 Compare May 22, 2026 22:20
@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jun 6, 2026
@github-actions github-actions Bot closed this Jun 13, 2026
@matheusaaguiar matheusaaguiar self-assigned this Jun 18, 2026
@matheusaaguiar matheusaaguiar removed stale The issue/PR was marked as stale because it has been open for too long. closed-due-inactivity labels Jun 18, 2026
@argotorg argotorg deleted a comment from github-actions Bot Jun 18, 2026
@argotorg argotorg deleted a comment from github-actions Bot Jun 18, 2026
@matheusaaguiar
matheusaaguiar force-pushed the fix-ice-copy-struct-function-type-member-copy-calldata-to-storage branch from 55d0c56 to 0a3f7a4 Compare June 18, 2026 13:07
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jul 3, 2026
@cameel cameel removed the stale The issue/PR was marked as stale because it has been open for too long. label Jul 5, 2026
<?isValueType>
<memberValues> := <read>(<memberValues>)
</isValueType>
<?dynamicallyEncodedMember>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think you even had to restructure it this much, could have just move the top portion (based on whether it's dynamically encoded or not) below the "is value type -> let := (memberSrcPtr)", i.e.

<?fromCalldata>
	<?isValueType>
		let <memberValues> := <read>(memberSrcPtr)
	<!isValueType>
		let <memberValues> :=
			<?dynamicallyEncodedMember>
				<accessCalldataTail>(value, memberSrcPtr)
			<!dynamicallyEncodedMember>
				memberSrcPtr
			</dynamicallyEncodedMember>
	</isValueType>
</fromCalldata>

Would have made for an easier diff I'd say, but your implementation is semantically equivalent, so no biggie.

Comment thread Changelog.md
* General: Remove support for the experimental EOF (EVM Object Format) backend.

Bugfixes:
* Codegen: Fix ICE when assigning a calldata struct containing a member of external function type to a storage struct.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gonna have to move this up into 0.8.37.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would add a few more tests:

  1. struct with external function ptr + uint64 (packing)
  2. struct with external function ptr + uint256[] array (dynamic)
  3. array of structs with external function ptr, i.e.
contract C {
  S[] storageStruct;
  ....
}

@matheusaaguiar
matheusaaguiar force-pushed the fix-ice-copy-struct-function-type-member-copy-calldata-to-storage branch from 0a3f7a4 to 6fff259 Compare July 16, 2026 00:17
@matheusaaguiar
matheusaaguiar force-pushed the fix-ice-copy-struct-function-type-member-copy-calldata-to-storage branch 2 times, most recently from 62d0bde to b6deae8 Compare July 17, 2026 20:52
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.

ICE: Invalid IR generated when assigning calldata struct with external function type member to storage

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.