mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Prevent panic from hax lexer (#812)
Prevents `runtime error: slice bounds out of range` when list is empty.
This commit is contained in:
parent
2aad7403e6
commit
68d976f00b
@ -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" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user