interp: show backtrace with error

This should make it much easier to figure out why and where an error
happens at package initialization time.
This commit is contained in:
Ayke van Laethem
2020-03-28 20:46:09 +01:00
committed by Ron Evans
parent 2501602b4f
commit cc4a4c755f
6 changed files with 70 additions and 73 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ func Run(mod llvm.Module, debug bool) error {
// function interprets the given function. The params are the function params
// and the indent is the string indentation to use when dumping all interpreted
// instructions.
func (e *evalPackage) function(fn llvm.Value, params []Value, indent string) (Value, error) {
func (e *evalPackage) function(fn llvm.Value, params []Value, indent string) (Value, *Error) {
fr := frame{
evalPackage: e,
fn: fn,