grain-lang / grain

The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾
https://grain-lang.org/
GNU Lesser General Public License v3.0
3.29k stars 114 forks source link

Verify reference management in `throw` compilation #813

Open peblair opened 3 years ago

peblair commented 3 years ago

In compcore.re, we currently don't do any special reference management for throw. We should determine whether the current semantics are correct, as this will become actually relevant once we have exception handling.

ospencer commented 2 years ago

They're not correct (we'd need to fixup references in each call frame on the way up the stack, and we can't). When exceptions are implemented we'd need to do something like catching and rethrowing the errors in all functions to make this work, which isn't great.