facebook / facebook/pyrefly

panic: key lacking binding with fuzzed assignment expressions and comprehensions

Open
#3,670 2 comments 0 reactions 1 assignee Claimed by @mikeleppane View on GitHub
crash help wanted stale
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

Pyrefly crashes when checking this fuzzed code:

```python
[(c:=)for c+]
[(c:=)for]
```

```
ERROR Thread panicked, shutting down: panicked at pyrefly/lib/binding/bindings.rs:518:13:
Internal error: key lacking binding, module=__unknown__, path=/home/user/crash.py, key=Key::Anywhere(c 1:3-4), key-debug=Anywhere((Name("c"), 2..3))
```

### Version info

Reproducible with 1.1.0.dev1 and commit 9ef0830d5

### Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIA2gBQDGiAvAJRi4BOABLQNQC6AOuhr1mrNgPQgANCDJsYYKKUIAXXAFsoFAMQcACqXmLSHNFjz4uudJADmAVzaoVEa4UG6AyjBgcAFioqxHCIAPShcgpKhOy2oTDooZi4tHChtNZ2js6uiRxiHKgAbqjQqNiwVjYQDk4u1hy4xPXocO7oZCp%2B1gC0RTBscLkcDBz8IADMhACMAEzjgpQDbOxwEvboEOrE7CowmD2YEPK0Lv0jHADkNejsMJeCtyo98gCO9sf7PQDWMKQ9qFotHgcAulwA7qg2OgHpIAL4yQFnGAAMWgMAoZhwBBI5DhQA

### (Only applicable for extension issues) IDE Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.