fix(info): handle missing deps field without unsigned indexOf wrap

This commit is contained in:
2026-08-08 18:54:05 -04:00
parent fc979b650d
commit 9473b01a79
4 changed files with 91 additions and 5 deletions
+13
View File
@@ -23,3 +23,16 @@ _Auto-scaffolded by /start-work. Append new entries below - never overwrite._
**Workaround in smoketest:** Recipe includes `deps = {}` to avoid triggering this bug.
---
## RESOLVED (task 27)
**Fixed:** `scanDepsArray` in `src/tofu/commands/info.d` — `size_t pos` → `ptrdiff_t pos`
so the `pos < 0` guard fires on `indexOf` returning -1. Added a regression unittest
(recipe without deps → infoCommand returns 0). Audit of the same pattern across
`info.d` (line 36), `recipeparse.d` (52, 112), `fetch.d` (82), `search.d`, `remove.d`,
`install.d` found no other unsigned indexOf assignment (`auto` infers `ptrdiff_t`
everywhere else).
Verified: `dub build` ✓, `dub test` — 23 modules passed ✓, smoketest — 16 checks PASS ✓.