github-vet / github-vet/rangeloop-pointer-findings
made2591/go-perceptron-go: model/neural/multiLayerNetwork.go; 38 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [made2591/go-perceptron-go](https://www.github.com/made2591/go-perceptron-go) at [model/neural/multiLayerNetwork.go](https://github.com/made2591/go-perceptron-go/blob/f9cb1d41709be57f3f5d407c39e08defd021f9ce/model/neural/multiLayerNetwork.go#L382-L419)
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.
> function call at line 385 passes reference to pattern to third-party code
[Click here to see the code in its original context.](https://github.com/made2591/go-perceptron-go/blob/f9cb1d41709be57f3f5d407c39e08defd021f9ce/model/neural/multiLayerNetwork.go#L382-L419)
Click here to show the 38 line(s) of Go which triggered the analyzer.
```go
for p_i, pattern := range patterns {
// back propagation
BackPropagate(mlp, &pattern, pattern.MultipleExpectation, 1)
if (epoch % 100 == 0 && p_i == p_i_r) {
// get output from network
o_out := Execute(mlp, &pattern, 1)
for o_out_i, o_out_v := range(o_out) {
o_out[o_out_i] = mu.Round(o_out_v, .5, 0)
}
log.WithFields(log.Fields{
"SUM": " ==========================",
}).Info()
log.WithFields(log.Fields{
"a_n_1": mu.ConvertBinToInt(pattern.Features[0:int(len(pattern.Features)/2)]),
"a_n_2": pattern.Features[0:int(len(pattern.Features)/2)],
}).Info()
log.WithFields(log.Fields{
"b_n_1": mu.ConvertBinToInt(pattern.Features[int(len(pattern.Features)/2):]),
"b_n_2": pattern.Features[int(len(pattern.Features)/2):],
}).Info()
log.WithFields(log.Fields{
"sum_1": mu.ConvertBinToInt(pattern.MultipleExpectation),
"sum_2": pattern.MultipleExpectation,
}).Info()
log.WithFields(log.Fields{
"sum_1": mu.ConvertBinToInt(o_out),
"sum_2": o_out,
}).Info()
log.WithFields(log.Fields{
"END": " ==========================",
}).Info()
}
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
The following graphviz dot graph describes paths through the callgraph that could lead to a function which passes a pointer to third-party code:
digraph G {
"(BackPropagate, 4)" -> {}
}
```
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: f9cb1d41709be57f3f5d407c39e08defd021f9ce
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.