golang/go

regexp: slice bounds out of range (2)

dvyukov opened this issue · 1 comments

package main

import "regexp"

func main() {
    regexp.MustCompile("((00(0){0}){3}){30}").ReplaceAllString("000000000", "000000$00")
}
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
regexp.(*machine).init(0xc2080c8240, 0x8)
    src/regexp/exec.go:92 +0x70
regexp.(*Regexp).doExecute(0xc2080f0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4c67b0, 0x9, 0x0, 0x8, ...)
    src/regexp/exec.go:454 +0x508
regexp.(*Regexp).replaceAll(0xc2080f0000, 0x0, 0x0, 0x0, 0x4c67b0, 0x9, 0x8, 0xc20807ded8, 0x0, 0x0, ...)
    src/regexp/regexp.go:486 +0xf8
regexp.(*Regexp).ReplaceAllString(0xc2080f0000, 0x4c67b0, 0x9, 0x4c6790, 0x9, 0x0, 0x0)
    src/regexp/regexp.go:449 +0x107
main.main()
    regexp.go:6 +0x64

go version devel +b0532a9 Mon Jun 8 05:13:15 2015 +0000 linux/amd64

CL https://golang.org/cl/14013 mentions this issue.