Repository navigation
Description
Problem
The parent-directory component .. is reported as having an extension. path_ext_start treats its final dot as an extension delimiter, so path_has_ext("..") returns true.
Starting points: std/path/analyze.wave.
Reproduction
Tested at 6257ba3eb4b9f1ab6c247a920c6e0c4b5d699331 on Linux amd64 with LLVM 21.1.8 and a compiler built from that checkout. Build it with LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo build --locked --jobs 2.
For a self-contained test against this checkout's std, create a temporary alias (leaving installed std unchanged):
python3 - <<'PYSETUP'
from pathlib import Path
import shutil
p = Path('/tmp/wave-issue-std')
shutil.copytree('std', p, dirs_exist_ok=True)
for f in p.rglob('*.wave'):
f.write_text(f.read_text().replace('"std::', '"checkout_std::'))
PYSETUPSave as repro.wave:
import("checkout_std::path::analyze")::{path_has_ext}; fun main() -> i32 { if (path_has_ext("..")) { return 1; } return 0; }
target/debug/wavec build repro.wave --dep checkout_std=/tmp/wave-issue-std -O0 --emit=ir,bin --out-dir /tmp/wave-issue-O0
/tmp/wave-issue-O0/repro
target/debug/wavec build repro.wave --dep checkout_std=/tmp/wave-issue-std -O2 --emit=ir,bin --out-dir /tmp/wave-issue-O2
/tmp/wave-issue-O2/reproBoth executables exit 1, showing that .. was classified as having an extension.
Scope
Exclude final components . and .. from extension detection. Preserve ordinary hidden-file and multiple-extension behavior, including the current separator policy.
Difficulty: easy.
Completion criteria
- Cover
.,..,dir/..and trailing separators. - Keep
.gitignore, ordinary names andarchive.tar.gzbehavior intact. - Check both extension offsets and predicates at O0/O2.
Activity