Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counterexample proposal: cross-stage persistence #13

Open
yallop opened this issue Dec 27, 2021 · 0 comments
Open

Counterexample proposal: cross-stage persistence #13

yallop opened this issue Dec 27, 2021 · 0 comments

Comments

@yallop
Copy link
Contributor

yallop commented Dec 27, 2021

The following MetaOCaml code, distilled from

Generating code with polymorphic let a ballad of value restriction, copying and sharing
Oleg Kiselyov

involves an unsound interaction between three MetaOCaml features:

  • polymorphic let
  • mutable references
  • cross-stage persistence
let lift x = .<x>.

let foo = Runcode.run
  .<let f () = .~(lift (ref None)) in
   f () := Some 2;
   match !(f ()) with Some x ->  x ^ "3" | None -> "" >.

Running it in (the latest versions of) BER MetaOCaml produces a segmentation fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant