Skip to content

Commit fdf88b5

Browse files
committed
remove assume from assert
1 parent e83307d commit fdf88b5

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

cmake/cage_build_configuration.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,4 @@ macro(cage_build_configuration)
100100
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
101101
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
102102
endif()
103-
104-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
105-
# __builtin_assume has side effects that are discarded
106-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-assume")
107-
endif()
108103
endmacro(cage_build_configuration)

sources/include/cage-core/core.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
#include <type_traits>
99
#include <utility>
1010

11-
#if defined(_MSC_VER)
12-
#define CAGE_ASSUME_TRUE(EXPR) __assume((bool)(EXPR))
13-
#elif defined(__clang__)
14-
#define CAGE_ASSUME_TRUE(EXPR) __builtin_assume((bool)(EXPR))
15-
#else
16-
#define CAGE_ASSUME_TRUE(EXPR)
17-
#endif
18-
1911
#ifdef CAGE_ASSERT_ENABLED
2012
#define CAGE_ASSERT(EXPR) \
2113
{ \
@@ -25,13 +17,9 @@
2517
int i_ = 42; \
2618
(void)i_; \
2719
} \
28-
CAGE_ASSUME_TRUE(EXPR); \
2920
}
3021
#else
31-
#define CAGE_ASSERT(EXPR) \
32-
{ \
33-
CAGE_ASSUME_TRUE(EXPR); \
34-
}
22+
#define CAGE_ASSERT(EXPR) {}
3523
#endif
3624

3725
#define CAGE_THROW_SILENT(EXCEPTION, ...) \

sources/libcore/errors/crashHandlerLinux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,17 @@ namespace cage
151151
{
152152
case SIGTERM:
153153
if (sigTermHandler)
154+
{
154155
sigTermHandler();
156+
return; // already handled, do not call default handler
157+
}
155158
break;
156159
case SIGINT:
157160
if (sigIntHandler)
161+
{
158162
sigIntHandler();
163+
return; // already handled, do not call default handler
164+
}
159165
break;
160166
}
161167

0 commit comments

Comments
 (0)