-
Notifications
You must be signed in to change notification settings - Fork 1
Description
In embedded context, such as when used within Candli, it is not acceptable that incorrect Ferlium code — such as an infinite loop — freezes the whole Candli runtime.
Once we compile Ferlium, we need to insert freeze detection inside the compiled code (e.g. at the CFG's loop back edges), and if the computing budget is consumed, generate a runtime error. However, this affects the calling convention, as if at least one freeze detection is performed, the enclosing function must be able to panic (i.e. being fallible).
A clean solution is to add an interruptable effect that, when present in a function, forces the ABI to generate panic support code. To achieve this, the IR must already be able to encode whether or not a function contains interruptable code.