Skip to content

Commit 510f145

Browse files
aykevldeadprogram
authored andcommitted
interp: show error line in first line of the traceback
1 parent e5e324f commit 510f145

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

interp/errors.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ func (e *Error) Error() string {
4747
// location of the instruction. The location information may not be complete as
4848
// it depends on debug information in the IR.
4949
func (e *evalPackage) errorAt(inst llvm.Value, err error) *Error {
50+
pos := getPosition(inst)
5051
return &Error{
5152
ImportPath: e.packagePath,
52-
Pos: getPosition(inst),
53+
Pos: pos,
5354
Err: err,
55+
Traceback: []ErrorLine{{pos, inst}},
5456
}
5557
}
5658

0 commit comments

Comments
 (0)