Skip to content

panic: Index out of range #22

@jcreixell

Description

@jcreixell

Resolving sourcemap locations can sometimes result in an index out of range panic. Example:

panic: runtime error: index out of range [200] with length 200
                                           │
goroutine 92843 [running]: 
  github.com/go-sourcemap/sourcemap.(*Consumer).source(0x1f91500?, 0x7013c60?, 0xc011cb69c0?, 0xc009221668?) 
     /go/pkg/mod/github.com/go-sourcemap/sourcemap@v2.1.4+incompatible/consumer.go:220 +0x1be
 github.com/go-sourcemap/sourcemap.(*Consumer).Source(0xb34?, 0x10470d?, 0x131011?) 
     /go/pkg/mod/github.com/go-sourcemap/sourcemap@v2.1.4+incompatible/consumer.go:178 +0x65 

I don't have a concrete sourcemap example to share, but I believe this is a bug or at least it should be handled more gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions