From 510f145a3a837c155ec3693513898c82aa8615dd Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Fri, 24 Jul 2020 12:46:18 +0200 Subject: interp: show error line in first line of the traceback --- interp/errors.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'interp') diff --git a/interp/errors.go b/interp/errors.go index f8c7e4e83..87c99587a 100644 --- a/interp/errors.go +++ b/interp/errors.go @@ -47,10 +47,12 @@ func (e *Error) Error() string { // location of the instruction. The location information may not be complete as // it depends on debug information in the IR. func (e *evalPackage) errorAt(inst llvm.Value, err error) *Error { + pos := getPosition(inst) return &Error{ ImportPath: e.packagePath, - Pos: getPosition(inst), + Pos: pos, Err: err, + Traceback: []ErrorLine{{pos, inst}}, } } -- cgit v1.2.3