Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Chisel memory and stack dumps break for assembly block ending with let #4938

Closed
2 tasks done
Sabnock01 opened this issue May 13, 2023 · 2 comments · Fixed by #9081
Closed
2 tasks done

In Chisel memory and stack dumps break for assembly block ending with let #4938

Sabnock01 opened this issue May 13, 2023 · 2 comments · Fixed by #9081
Assignees
Labels
C-chisel Command: chisel T-bug Type: bug
Milestone

Comments

@Sabnock01
Copy link
Contributor

Sabnock01 commented May 13, 2023

Component

Chisel

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

chisel 0.1.1 (58a2729 2023-05-15T00:04:42.785499234Z)

What command(s) is the bug in?

No response

Operating System

Linux

Describe the bug

When inputting the following subsection of LibString.sol into Chisel, memory !md and stack !sd dumps are not functional.

This appears to happen any time a variable is declared in the run function but not initialized where !md and !sd will report erroneously that the function is empty.

image

@Sabnock01 Sabnock01 added the T-bug Type: bug label May 13, 2023
@gakonst gakonst added this to Foundry May 13, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry May 13, 2023
@Sabnock01
Copy link
Contributor Author

Sabnock01 commented May 14, 2023

This appears to happen also any time an assembly block ends with a let statement.

A workaround I've found is to declare all variables externally and simply remove the let keywords from the block.

@zerosnacks zerosnacks added the C-chisel Command: chisel label Jul 2, 2024
@zerosnacks
Copy link
Member

Able to reproduce with given setup

chisel
uint256 value = 12345;
string memory str;
assembly {
str := add(mload(0x40), 0x80)
mstore(0x40, add(str, 0x20))
mstore(str, 0)
let end := str
}

@zerosnacks zerosnacks changed the title memory and stack dumps break for assembly block in chisel In Chisel memory and stack dumps break for assembly block ending with let Jul 2, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy moved this from Todo to In Progress in Foundry Oct 9, 2024
@grandizzy grandizzy self-assigned this Oct 9, 2024
@grandizzy grandizzy moved this from In Progress to Ready For Review in Foundry Oct 9, 2024
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry Oct 10, 2024
@grandizzy grandizzy moved this from Done to Completed in Foundry Oct 14, 2024
@grandizzy grandizzy removed this from Foundry Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chisel Command: chisel T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants