github-vet / github-vet/rangeloop-pointer-findings

njm256/vezir: engine/mcts.go; 5 LoC

Open
#14,234 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [njm256/vezir](https://www.github.com/njm256/vezir) at [engine/mcts.go](https://github.com/njm256/vezir/blob/ebace5d1aa49a87c3e3ae730975f898633bff1e2/engine/mcts.go#L50-L54)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.

> reference to v is reassigned at line 52

[Click here to see the code in its original context.](https://github.com/njm256/vezir/blob/ebace5d1aa49a87c3e3ae730975f898633bff1e2/engine/mcts.go#L50-L54)

Click here to show the 5 line(s) of Go which triggered the analyzer.

```go
for _, v := range tree.root.children {
if float64(v.score)/float64(v.sims) > float64(best.score)/float64(best.sims) {
best = &v
}
}

```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: ebace5d1aa49a87c3e3ae730975f898633bff1e2

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with engine/mcts.go lines 50-54 and the linked original context. Check whether the analyzer's reported reassignment represents a real issue in this usage, then classify the finding by leaving the appropriate reaction; completion is the selected classification.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.