Skip to content

regexp: slice bounds out of range (2) #11178

Description

@dvyukov
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions