Skip to content

Commit

Permalink
fix: avoid panic on empty lines when parsing arm64 assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
asdine committed Jul 14, 2023
1 parent fb00f6d commit 732a8b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parser_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ func parseAssembly(path string) (map[string][]Line, error) {
functions[functionName] = append(functions[functionName], Line{Assembly: asm})
} else {
lines := functions[functionName]
lines[len(lines)-1].Assembly = asm
if len(lines) > 0 {
lines[len(lines)-1].Assembly = asm
}
labelName = ""
}
}
Expand Down

0 comments on commit 732a8b4

Please sign in to comment.