From 732a8b49ab06532f979e9c3654cc287235ad1e40 Mon Sep 17 00:00:00 2001 From: Asdine El Hrychy Date: Fri, 14 Jul 2023 15:38:08 +0200 Subject: [PATCH] fix: avoid panic on empty lines when parsing arm64 assembly --- parser_arm64.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser_arm64.go b/parser_arm64.go index d41f67d..ceb39f2 100644 --- a/parser_arm64.go +++ b/parser_arm64.go @@ -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 = "" } }