software-mansion / software-mansion/cairo-debugger
Fix unit types mappings
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7
- Forks
- 2
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 1
Description
Unit type sierra vars sometimes map to non-unit type Cairo vars. It is the effect of some functions like add_assign returning unit type (assignment happens via ref argument). The unit type then have a stable location that we treat as one corresponding to the non-unit type Cairo var. Example:
let mut x = 0;
x += 5; // `add_assign` is called under the hood and the resulting sierra var id of unit type maps to (IIRC) to the whole `x += 5` expression
Potential solution: ignore sierra vars that map to whole assignment expression (check if it does not have unintended consequences!)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Sierra variables from functions such as add_assign are mapped to Cairo variables, using the x += 5 example as a minimal case. Check whether variables representing the whole assignment expression can be ignored without affecting other mappings; done means unit-type variables no longer map to the corresponding non-unit Cairo variable incorrectly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100