github-vet / github-vet/rangeloop-pointer-findings
grellyd/cpsc_416_p1_blockchain_art: minerlib/canvas_operations.go; 34 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [grellyd/cpsc_416_p1_blockchain_art](https://www.github.com/grellyd/cpsc_416_p1_blockchain_art) at [minerlib/canvas_operations.go](https://github.com/grellyd/cpsc_416_p1_blockchain_art/blob/6141c2fb8cbb1dc19d667f7c94b34778a042981b/minerlib/canvas_operations.go#L55-L88)
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 op is reassigned at line 57
[Click here to see the code in its original context.](https://github.com/grellyd/cpsc_416_p1_blockchain_art/blob/6141c2fb8cbb1dc19d667f7c94b34778a042981b/minerlib/canvas_operations.go#L55-L88)
Click here to show the 34 line(s) of Go which triggered the analyzer.
```go
for _, op := range ops {
if op.Type == blockartlib.NOP {
validOps[op.ShapeHash] = &op
continue
}
if op.Type == blockartlib.DELETE {
drawnShapes, err = RemoveDrawnShape(op, drawnShapes)
if err != nil {
invalidOps[op.ShapeHash] = &op
return validOps, invalidOps, err
}
validOps[op.ShapeHash] = &op
continue
}
shape, err := OperationToShape(op, canvasSettings)
if err != nil {
return validOps, invalidOps, err
}
overlapsSomething := false
for _, valid := range drawnShapes {
if strings.Compare(valid.Owner, shape.Owner) == 0 {
continue
}
if IsShapesOverlapping(valid, shape) {
overlapsSomething = true
}
}
if overlapsSomething {
invalidOps[op.ShapeHash] = &op
} else {
validOps[op.ShapeHash] = &op
drawnShapes = append(drawnShapes, shape)
}
}
```
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: 6141c2fb8cbb1dc19d667f7c94b34778a042981b
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.