mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 14:48:37 +00:00
--json was checked with a raw os.path.samefile against index.json only, so naming an indexed .dxbc container or a disasm/*.s listing overwrote that input, and a directory ran survey() (llvm-mc over the corpus) before the write failed. main() now refuses, before survey() runs, a --json that is an existing directory, and one that tools/report_paths.same_report_path matches against index.json or any container or listing the index names (input_paths(), which shares load_index() with survey()). Each refusal is one error line and exit 2. Synthetic tests in tests/test_vs_layout_census.py: a listing, a container and index.json refuse and stay unchanged; a directory refuses with survey() and default_disasm mocked and never called; a ../ spelling, a symlink, a hard link and (on a case-folding volume) another case refuse; a separate --json still runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>