Genex: Fix crash on out of range LIST index

This commit is contained in:
Tyler Yankee committed 2026-11-02 09:02:15 -05:00
1 parent 4e0fa8da34
commit 25abbc4ad4
5 files changed
+14

No files matched your search

+2
View File
@@ -973,6 +973,8 @@ bool GetNumericArgument(std::string const& arg, IndexType& value)
}
} catch (std::invalid_argument const&) {
return false;
} catch (std::out_of_range const&) {
return false;
}
return true;
@@ -0,0 +1 @@
1
@@ -0,0 +1,8 @@
CMake Error at INSERT-wrong-index3\.cmake:[0-9]+ \(file\):
Error evaluating generator expression:
\$<LIST:INSERT,a;b;c,34337407431768211457,d>
index: "34337407431768211457" is not a valid index
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)
@@ -0,0 +1,2 @@
file(GENERATE OUTPUT result.txt CONTENT "$<LIST:INSERT,a;b;c,34337407431768211457,d>")
@@ -69,6 +69,7 @@ run_cmake(SUBLIST-wrong-argument1)
run_cmake(SUBLIST-wrong-argument2)
run_cmake(INSERT-wrong-index1)
run_cmake(INSERT-wrong-index2)
run_cmake(INSERT-wrong-index3)
run_cmake(REMOVE_AT-wrong-index1)
run_cmake(REMOVE_AT-wrong-index2)
run_cmake(REMOVE_AT-wrong-index3)