Skip to content

Commit 5411d80

Browse files
authored
pkg/symbolizer: Fix parser handling of small hex values
The parser in symbolizer presently breaks out of the for loop if it receives a hex value, to indicate it has reached the next PC, or the sentinel. The condition for breaking the loop is: if len(ln) > 3 && ln[0] == '0' && ln[1] == 'x', this does not catch 0xc, for example len(ln) >= 3 && ln[0] == '0' && ln[1] == 'x' is correct for such cases. Fixes #6290
1 parent 1804e95 commit 5411d80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/symbolizer/addr2line.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func parse(interner *Interner, s *bufio.Scanner) ([]Frame, error) {
138138
var frames []Frame
139139
for s.Scan() {
140140
ln := s.Text()
141-
if len(ln) > 3 && ln[0] == '0' && ln[1] == 'x' {
141+
if len(ln) >= 3 && ln[0] == '0' && ln[1] == 'x' {
142142
break
143143
}
144144
fn := ln

0 commit comments

Comments
 (0)