Tealer error in check_rekey_to
- Dominant language
- Python
- Stars
- 63
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
When running the command `tealer contract.teal`, I get the following error:
```
Traceback (most recent call last):
File "/Users/gidon/tealer/venv/bin/tealer", line 33, in
sys.exit(load_entry_point('tealer==0.0.2', 'console_scripts', 'tealer')())
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/__main__.py", line 75, in main
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/detectors/rekeyto.py", line 79, in detect
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/detectors/rekeyto.py", line 74, in check_rekey_to
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/detectors/rekeyto.py", line 74, in check_rekey_to
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/detectors/rekeyto.py", line 74, in check_rekey_to
[Previous line repeated 18 more times]
File "/Users/gidon/tealer/venv/lib/python3.8/site-packages/tealer-0.0.2-py3.8.egg/tealer/detectors/rekeyto.py", line 54, in check_rekey_to
KeyError: 4
```
I haven't managed to isolate the breaking code (the teal code is over 2000 lines) so I am not sure what the issue is.
When I run the command with the `--print-cfg` option then it does successfully create the CFG.
Contributor guide
Research direction
Reproduce the failure with `tealer contract.teal` and inspect `tealer/detectors/rekeyto.py`, especially the recursive `check_rekey_to` path reported in the traceback. Compare this with the successful `--print-cfg` run and isolate a smaller input that still raises `KeyError: 4`; done means the detector handles that input without the exception and the regression is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100