ekmett / ekmett/stable-maps

We still have a (big) safety problem

Open
#10 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Suppose we have

```haskell
x :: Either Int Char
x = Right 'a'

y :: Either Bool Char
y = Right 'a'
```

Thanks to some CMM-level optimizations, it is possible that `x` and `y` will live at the same address. I can insert `(x, Identity (Left 3))` into the map, then perform a lookup with `y` and get something utterly wrong.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue's example with x :: Either Int Char, y :: Either Bool Char, and the map insertion of (x, Identity (Left 3)). Investigate the lookup path under CMM-level optimizations; done means a lookup with y cannot return the value associated with x when both share an address.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
data
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.