Skip to content

Commit

Permalink
Merge pull request #196 from nakabonne/avoid-panic
Browse files Browse the repository at this point in the history
Allow -0 as an octet integer value
  • Loading branch information
goccy authored Feb 2, 2021
2 parents 607728c + 65b8c9b commit 868d322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func Integer(tk *token.Token) Node {
negativePrefix := ""
if value[0] == '-' {
skipCharacterNum++
if value[2] == 'o' {
if len(value) > 2 && value[2] == 'o' {
skipCharacterNum++
}
negativePrefix = "-"
Expand Down

0 comments on commit 868d322

Please sign in to comment.