Commit cea0b130 authored by protolambda's avatar protolambda Committed by inphi

op-chain-ops: handle bad sourcemap data in sol tracer

parent 4a02eb4d
...@@ -95,6 +95,9 @@ func (s *SourceMap) Info(pc uint64) (source string, line uint32, col uint32) { ...@@ -95,6 +95,9 @@ func (s *SourceMap) Info(pc uint64) (source string, line uint32, col uint32) {
if s.PosData[instr.F] == nil { // when the source file is known to be unavailable if s.PosData[instr.F] == nil { // when the source file is known to be unavailable
return return
} }
if int(instr.S) >= len(s.PosData[instr.F]) { // possibly invalid / truncated source mapping
return
}
lc := s.PosData[instr.F][instr.S] lc := s.PosData[instr.F][instr.S]
line = lc.Line line = lc.Line
col = lc.Col col = lc.Col
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment