Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
268: Improve internal reporting of errors in `vm`/`vmgen` r=saem a=zerbina Reporting of guest code related errors was done in an inconsistent manner via either `stackTrace` or `globalReport`, where `stackTrace` used `localReport` and an injected `return` statement to terminate the execution loop. `stackTrace` was sometimes used in nested functions, thus not terminating execution at all. ### Changes Both the execution engine and `vmgen` now use exceptions for error propagation internally, translating them into a result value at their respective interface edges. In case of an error, the result value stores the error report. Otherwise, it stores the actual result. In addition, some usages of `globalReport` are also replaced with the new error propagation mechanism. Depending on whether or not a VM invocation is expected to return something, errors reported from VM execution and/or `vmgen` are either turned into a `nkError` node or handled directly via `handleReport` Fixes #160 Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
- Loading branch information