Some sanitiser actions might not just cause warnings, but also irrecoverably fail the entire sanitisation process. Examples include trying to get information about the current program when the sanitiser isn't visiting a program.
Currently, there is no easy way to do this, because the sanitiser lives inside a state monad and the idiom for errors in the rest of act is the Or_error monad.
Adding error return support here is actually quite tricky, involving the following changes:
Generalising the state monad into a state transformer, so it can sit on top of Or_error and combine the effects. I've already done this in my working copy, but my OCaml environment has shredded itself (!), so it'll be a while before I can continue;
Generalising the various foldMap traversals (mostly in x86) so that they can fail—this'll be the tricky bit;
Porting Sanitiser_ctx from state to state transformer;
Porting Sanitiser to handle the changes in its underlying monad.
Until this gets done, I'm mainly just emitting errors as warnings, which is fairly janky.
Some sanitiser actions might not just cause warnings, but also irrecoverably fail the entire sanitisation process. Examples include trying to get information about the current program when the sanitiser isn't visiting a program.
Currently, there is no easy way to do this, because the sanitiser lives inside a state monad and the idiom for errors in the rest of
act
is theOr_error
monad.Adding error return support here is actually quite tricky, involving the following changes:
Or_error
and combine the effects. I've already done this in my working copy, but my OCaml environment has shredded itself (!), so it'll be a while before I can continue;foldMap
traversals (mostly in x86) so that they can fail—this'll be the tricky bit;Sanitiser_ctx
from state to state transformer;Sanitiser
to handle the changes in its underlying monad.Until this gets done, I'm mainly just emitting errors as warnings, which is fairly janky.