Skip to content

Commit c1becd4

Browse files
authored
Merge pull request robfig#64 from sinacloud/master
Step of range should be a positive number
2 parents 6f2e828 + afe0337 commit c1becd4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

parser.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ func getRange(expr string, r bounds) uint64 {
114114
if start > end {
115115
log.Panicf("Beginning of range (%d) beyond end of range (%d): %s", start, end, expr)
116116
}
117+
if step == 0 {
118+
log.Panicf("Step of range should be a positive number: %s", expr)
119+
}
117120

118121
return getBits(start, end, step) | extra_star
119122
}

0 commit comments

Comments
 (0)