diff options
author | Ayke van Laethem <[email protected]> | 2020-07-24 12:46:18 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-08-25 17:34:32 +0200 |
commit | 510f145a3a837c155ec3693513898c82aa8615dd (patch) | |
tree | 14be8ef19f36890614c1cc9a07ae523b4942aaf1 /interp | |
parent | e5e324f93e81343a45c9964e0abcbec424ad739d (diff) | |
download | tinygo-510f145a3a837c155ec3693513898c82aa8615dd.tar.gz tinygo-510f145a3a837c155ec3693513898c82aa8615dd.zip |
interp: show error line in first line of the traceback
Diffstat (limited to 'interp')
-rw-r--r-- | interp/errors.go | 4 |
1 files changed, 3 insertions, 1 deletions
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}}, } } |