Conversation
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: David Justo (davidmrdavid) ChangesFollow up to: #159618 Context The linked PR ^ introduced a new test to ensure that ASan on Windows no longer instruments catch-parameters. This test used a non-standard constructor of This was originally reported by @mstorsjo, in this comment: from: #159618 (comment) This PR adjusts the faulty test case to rely on Full diff: https://github.com/llvm/llvm-project/pull/164137.diff 1 Files Affected:
diff --git a/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
index 6f028147c9049..8d1b9ef17393f 100644
--- a/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
@@ -7,13 +7,14 @@
// This code is based on the repro in https://github.com/google/sanitizers/issues/749
#include <cstdio>
#include <exception>
+#include <stdexcept>
-void throwInFunction() { throw std::exception("test2"); }
+void throwInFunction() { throw std::runtime_error("test2"); }
int main() {
// case 1: direct throw
try {
- throw std::exception("test1");
+ throw std::runtime_error("test1");
} catch (const std::exception &ex) {
puts(ex.what());
// CHECK: test1
|
|
Thanks for the fix-forward! Btw, some quirks of LLVM:
|
|
thanks for the info! Next time I'll do a quick revert, and fix later. Got it! |
Follow up to: #159618
Context
The linked PR ^ introduced a new test to ensure that ASan on Windows no longer instruments catch-parameters. This test used a non-standard constructor of
std::exception,one that accepted strings as their input, which somehow passed the PR CI but would fail to compile on mingw with libc++.This was originally reported by @mstorsjo, in this comment:
from: #159618 (comment)
This PR adjusts the faulty test case to rely on
std::runtime_error, which contains a standard constructor accepting a string. This should suffice to make the test pass on mingw. I tested this on godbolt: https://godbolt.org/z/M4hPv5Wvx