Skip to content

Distance Limit does not check if it in range #1

@RedTeaDev

Description

@RedTeaDev
panic: runtime error: index out of range [-1]

goroutine 16 [running]:
github.com/dertseha/everoute/travel/search.(*routeChromosomeSplicer).random(0xc000099680, {0xb388a8, 0x0, 0x30?}, 0x0)
        /home/redtea/go/src/github.com/dertseha/everoute/travel/search/RouteChromosomeSplicer.go:17 +0x225
github.com/dertseha/everoute/travel/search.(*routeFinder).ensurePopulationSize(0xc000104a00, {0xc001c7e1b0?, 0x0?, 0x0?})
        /home/redtea/go/src/github.com/dertseha/everoute/travel/search/RouteFinder.go:87 +0x7f
github.com/dertseha/everoute/travel/search.(*routeFinder).IncubatorEmpty.func1()
        /home/redtea/go/src/github.com/dertseha/everoute/travel/search/RouteFinder.go:70 +0x14c
github.com/dertseha/everoute/util.SingleThreadExecutor.func1()
        /home/redtea/go/src/github.com/dertseha/everoute/util/SingleThreadExecutor.go:19 +0x3d
created by github.com/dertseha/everoute/util.SingleThreadExecutor
        /home/redtea/go/src/github.com/dertseha/everoute/util/SingleThreadExecutor.go:24 +0x9a
root@vmi585337:/home/redtea/everouting/backend# ./start.sh

If you passes a very large value, it will panic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions