mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-22 05:19:03 +00:00
interp: show error line in first line of the traceback
This commit is contained in:
committed by
Ron Evans
parent
e5e324f93e
commit
510f145a3a
+3
-1
@@ -47,10 +47,12 @@ func (e *Error) Error() string {
|
|||||||
// location of the instruction. The location information may not be complete as
|
// location of the instruction. The location information may not be complete as
|
||||||
// it depends on debug information in the IR.
|
// it depends on debug information in the IR.
|
||||||
func (e *evalPackage) errorAt(inst llvm.Value, err error) *Error {
|
func (e *evalPackage) errorAt(inst llvm.Value, err error) *Error {
|
||||||
|
pos := getPosition(inst)
|
||||||
return &Error{
|
return &Error{
|
||||||
ImportPath: e.packagePath,
|
ImportPath: e.packagePath,
|
||||||
Pos: getPosition(inst),
|
Pos: pos,
|
||||||
Err: err,
|
Err: err,
|
||||||
|
Traceback: []ErrorLine{{pos, inst}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user