LINK_OPTIONS: Fix crash on empty LINKER: prefix

Since commit e3895f4a8b (Linking: Preserve nested LINKER: prefixes as
written, 2024-09-17, v3.31.0-rc1~60^2) we may increment an iterator past
the end.  Revise logic to avoid that.

Fixes: #26499
This commit is contained in:
Brad King
2024-12-04 09:47:18 -05:00
parent bf9b13920d
commit 76f4fc7dd0
2 changed files with 5 additions and 3 deletions
@@ -26,6 +26,7 @@ endfunction()
# Use LINKER alone
add_test_library(linker)
target_link_options(linker PRIVATE "LINKER:-foo,bar")
target_link_options(linker PRIVATE "LINKER:") # empty
# Use LINKER with SHELL
add_test_library(linker_shell)