diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-27 18:51:09 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-27 19:52:06 (GMT) |
commit | a33b3949e5337da978828d611f3ca3f08bcda21b (patch) | |
tree | 8fcb374c3a5e20596f3c9135160a9698cf1777cc /Tests/RunCMake/foreach | |
parent | 813b28902320831c0a668d1a6dc30817c87c73c3 (diff) | |
download | CMake-a33b3949e5337da978828d611f3ca3f08bcda21b.zip CMake-a33b3949e5337da978828d611f3ca3f08bcda21b.tar.gz CMake-a33b3949e5337da978828d611f3ca3f08bcda21b.tar.bz2 |
foreach: Fix crash when parsing invalid integer
Fixes: #20393
Diffstat (limited to 'Tests/RunCMake/foreach')
19 files changed, 48 insertions, 0 deletions
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake index 8f50203..6bb0683 100644 --- a/Tests/RunCMake/foreach/RunCMakeTest.cmake +++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake @@ -12,3 +12,9 @@ run_cmake(foreach-ZIP_LISTS-with-LISTS-mix-test) run_cmake(foreach-ZIP_LISTS-multiple-iter-vars-test) run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-1) run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-2) +run_cmake(foreach-RANGE-non-int-test-1) +run_cmake(foreach-RANGE-non-int-test-2-1) +run_cmake(foreach-RANGE-non-int-test-2-2) +run_cmake(foreach-RANGE-non-int-test-3-1) +run_cmake(foreach-RANGE-non-int-test-3-2) +run_cmake(foreach-RANGE-non-int-test-3-3) diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-stderr.txt new file mode 100644 index 0000000..78355dc --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-1\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1.cmake new file mode 100644 index 0000000..452fbdf --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-1.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE b) +endforeach() diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-stderr.txt new file mode 100644 index 0000000..787ffc1 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-2-1\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1.cmake new file mode 100644 index 0000000..885c805 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-1.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE b 1) +endforeach() diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-stderr.txt new file mode 100644 index 0000000..70cc73f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-2-2\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2.cmake new file mode 100644 index 0000000..d52aeb9 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-2-2.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE 1 b) +endforeach() diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-stderr.txt new file mode 100644 index 0000000..5803fe8 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-3-1\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1.cmake new file mode 100644 index 0000000..33a488d --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-1.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE b 1 1) +endforeach() diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-stderr.txt new file mode 100644 index 0000000..189c60d --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-3-2\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2.cmake new file mode 100644 index 0000000..ff119d3 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-2.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE 1 b 1) +endforeach() diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-stderr.txt new file mode 100644 index 0000000..ee9e62c --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-non-int-test-3-3\.cmake:[0-9]+ \(foreach\): + foreach Invalid integer: 'b' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3.cmake b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3.cmake new file mode 100644 index 0000000..fdebdf0 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-non-int-test-3-3.cmake @@ -0,0 +1,2 @@ +foreach(a RANGE 1 1 b) +endforeach() |