Skip to content

Conversation

@roman-kashitsyn
Copy link

Currently, if a compiler panics, the error is recorded into a local
variable defined in the scope of a Compile* function. This variable
however has no direct relation to the return value of the function.
So if a panic actually happens, the last return statement is not
executed and the function just returns empty default values.

This behaviour results in errors being silently discurded, the
concequences of such errors are typically discovered much later during
execution (e.g., as index out of bounds panics in vm.go).

After this change, panics in Compile* functions are always propagated
to the caller as errors.

Currently, if a compiler panics, the error is recorded into a local
variable defined in the scope of a Compile* function.  This variable
however has no direct relation to the return value of the function.
So if a panic actually happens, the last `return` statement is not
executed and the function just returns empty default values.

This behaviour results in errors being silently discurded, the
concequences of such errors are typically discovered much later during
execution (e.g., as index out of bounds panics in vm.go).

After this change, panics in Compile* functions are always propagated
to the caller as errors.
@roman-kashitsyn
Copy link
Author

Ok, seems to be a duplicate of #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant