Skip to content

Danger of integer overflow #65

Description

@S1yGus

FORCEINLINE Position operator+(const Input& input) const { return {x + input.x, y + input.y}; }

Potentially dangerous operator overload that may cause integer overflow (uint + int). Specifically, in the current implementation of the game, there should be no issues as the Input should not exceed the value range of -1 to 1, and the Position of possible cells for movement starts from x = 1, y = 1 due to the walls on the grid. However, it is advisable to refactor to eliminate the potential problem.

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions