Static verifications
This issue is mainly a non-exhaustive list of static verification it would be nice to have within OVM.
Depending on the implementation, some might be redundant with others.
- Programs must have a procedure
main
(i.e:label main ... label end
) - Functions calls must correspond either to runtime functions or to labels of procedures
- Labels must be uniquely defined
- Jumps must go to a label that is defined, and that is not a label of a procedure.
- Jumps can go toward the root of the AST (i.e we can interrupt the evaluation of some expression/instruction, but not jump straight into the middle of one)
- Have a form of (partial) type checking
- Arity checking for functions calls
- Valid usage of arguments
i0, i1 ... in
in function body (i.e n < arity) - Check that read accesses are made after a write
Finally, i believe those checks must be performed by default, but we should give the user a way of disabling them (--unsafe
?)