Skip to content

Fix path list tail after resolving dot segments - #1005

Closed
agammann wants to merge 1 commit into
EpicGames:masterfrom
agammann:fix/path-dot-resolution
Closed

agammann wants to merge 1 commit into
EpicGames:masterfrom
agammann:fix/path-dot-resolution

Conversation

@agammann

@agammann agammann commented Oct 8, 2026 •

Copy link
Copy Markdown

Problem

path_normalized_from_string("a/b/..") returns a String8 with size 1, but the bytes through its NUL terminator are a/b. The path list decrements its counts when removing b yet leaves that node linked. a/.. likewise leaves a node in a list whose count is zero.

Change

Save each stack node’s predecessor and restore the list tail when .. removes that node. Add base tests for relative paths, an empty result, leading parent segments, and a Windows absolute path.

Verification

  • On Ubuntu WSL, ./run_tests.sh gcc debug -- path_dot_resolution and ./run_tests.sh clang debug -- path_dot_resolution each built all five targets and passed the new torture test (1 passed, 0 failed/crashed/skipped). The mounted checkout used core.filemode=false.
  • cd build && ./torture -gcc:/usr/bin/gcc "base/*": all 7 base tests passed, 0 failed/crashed/skipped.
  • A focused runner compiled against the original master source failed the new tail assertion; the same runner passed with this patch. Directly, path_normalized_from_string("a/b/..") changed from size == 1 with C string a/b to size 1 with C string a.
  • git diff --check passes; the working tree is clean.

The full torture matrix did not complete on WSL: linker/long_section_name fails with unresolved RAD_IMPORT_STUB. I reproduced the same failure on a separate untouched upstream checkout (b6d8c3f) after building both torture and radlink. A run excluding linker tests stalled at rdi_from_pdb/p2r_determinism while reporting missing debug information, so I stopped it.

@ryanfleury ryanfleury closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants