Skip to content

getZipper with an empty component list loops up to SIZE_MAX #531

Open

Description

@Exeloo

Which package is this bug report for?

ecs

Issue description

Registry::get_zipper (modules/ecs/wasm/Registry.hpp#L295-L322) starts with max = SIZE_MAX and only lowers it inside the loop over the given components. With an empty array, max stays SIZE_MAX, so the second loop runs up to SIZE_MAX and never ends in practice. Read from the code, not run.

Expected: getZipper([]) returns an empty array, or throws a clear error.

Found during the cli bug sweep of 2026-11-23, from NanoForge-dev/CLI#308 (part 3).

Code sample

registry.getZipper([]); // max stays SIZE_MAX

Versions

  • @nanoforge-dev/ecs 3.0.0, @nanoforge-dev/network 3.0.0 (engine main d62a790)
  • TypeScript 6.0.3
  • Node.js 26
  • Linux

Issue priority

Low (slightly annoying)

I have tested this issue on a development release

No response

Activity

  1. added
    bug
    on Nov 23, 2026
  2. added
    modules:ecs
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmodules:ecs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions