mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
fix: avoid implicit memory aliasing in for loop
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2503271956
|
v5.0.0-beta-2503311054
|
||||||
|
|||||||
+3
-1
@@ -63,7 +63,9 @@ func (p *ActionParser) parseJSON(predictionText string) ([]ParsedAction, error)
|
|||||||
|
|
||||||
// normalize actions
|
// normalize actions
|
||||||
var normalizedActions []ParsedAction
|
var normalizedActions []ParsedAction
|
||||||
for _, action := range response.Actions {
|
for i := range response.Actions {
|
||||||
|
// create a new variable, avoid implicit memory aliasing in for loop.
|
||||||
|
action := response.Actions[i]
|
||||||
if err := p.normalizeAction(&action); err != nil {
|
if err := p.normalizeAction(&action); err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to normalize action")
|
return nil, errors.Wrap(err, "failed to normalize action")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user