Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent panic from hax lexer
Prevents `runtime error: slice bounds out of range` when list is empty.
  • Loading branch information
alanhamlett authored Aug 15, 2023
commit 79a369af8b56d9e77d848b5aa6109880c4e5a950
4 changes: 3 additions & 1 deletion lexers/haxe.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ func haxePreProcMutator(state *LexerState) error {
state.Stack = stack[len(stack)-1]
}
case "end":
stack = stack[:len(stack)-1]
if len(stack) > 0 {
stack = stack[:len(stack)-1]
}
}

if proc == "if" || proc == "elseif" {
Expand Down