Skip to content

Code Quality: Issues found with PVS-Studio Static Analyzer #981

Description

@rip-mm

Hello.

I am a developer at PVS-Studio and I have checked the project using the PVS-Studio analyzer. If you could take a look at suspicious fragment:

func (vec *Vector) Push(value core.Value) *Vector {
  slice := vec.getCurrentSlice()
  slice[len(slice)] = value

  return vec
}

PVS-Studio warning: V8031 Using the call of the 'len' function as index will cause off-by-one error. Consider using 'len(slice) - 1' instead. vector.go 28

If there is anything I can do to assist, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions