-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e4a55c
commit fc01f84
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Fix soundness problem with matching iso variables | ||
|
||
We previously switched our underlying type system model. In the process, a | ||
soundness hole was introduced. The following code that should not compile was accepted by the compiler: | ||
|
||
```pony | ||
class Bad | ||
let _s: String iso | ||
new iso create(s: String iso) => | ||
_s = consume s | ||
fun ref take(): String iso^ => | ||
match _s | ||
| let s': String iso => consume s' | ||
end | ||
``` | ||
|
||
The code should not compile because `let s': String iso` is aliasing `_s` an iso field. Consuming an aliases iso shouldn't return an iso^. | ||
|
||
The take-away is that "very bad things could happen" and the data race freedom guarantees of the Pony compiler were being violated. | ||
|
||
We've close the soundness hole. We recommend all Pony users update to the this release as soon as possible. |