Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mvertes
Copy link
Collaborator

@mvertes mvertes commented Apr 27, 2022

Use direct assignment instead of reflect.Value Set method to
initialize a binary composite type, as for non binary types.
It ensures that a new reflect.Value is stored in the frame
instead of modifying a possibly existing one, which can defeat
the purpose of initializing variables in a body loop.

While there, remove the need to have and use a mutex on types.

Fixes #1381.

Use direct assignment instead of reflect.Value Set method to
initialize a binary composite type, as for non binary types.
It ensures that a new reflect.Value is stored in the frame
instead of modifying a possibly existing one, which can defeat
the purpose of initializing variables in a body loop.

While there, remove the need to have and use a mutex on types.

Fixes traefik#1381.
@mvertes mvertes added this to the v0.11.x milestone Apr 27, 2022
@mvertes mvertes requested a review from mpl April 27, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent variable initialization inside loop

3 participants