interp: show error line in first line of the traceback

This commit is contained in:
Ayke van Laethem
2020-07-24 12:46:18 +02:00
committed by Ron Evans
parent e5e324f93e
commit 510f145a3a
+3 -1
View File
@@ -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}},
}
}