aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxxrt/patches/do-upcast-not-cast-to.patch
blob: 93fce488a54703c670773bf224826e0dbbfdf633 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- contrib/libs/cxxsupp/libcxxrt/exception.cc	(index)
+++ contrib/libs/cxxsupp/libcxxrt/exception.cc	(working tree)
@@ -321,7 +321,7 @@ static void terminate_with_diagnostics() {
-		if (throw_ti)
-		{
-			std::exception *e =
-				static_cast<std::exception*>(e_ti->cast_to(static_cast<void*>(ex+1), throw_ti));
-			if (e)
-			{
-				fprintf(stderr, " '%s'", e->what());
+		if (throw_ti) {
+			void* ptr = ex + 1;
+			if (throw_ti->__do_upcast(e_ti, &ptr)) {
+				std::exception* e = static_cast<std::exception*>(ptr);
+				if (e) {
+					fprintf(stderr, "    what() -> \"%s\"\n", e->what());
+				}