We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1808c0f commit 6e19dd5Copy full SHA for 6e19dd5
include/cmcpp/context.hpp
@@ -80,18 +80,16 @@ namespace cmcpp
80
81
inline void trap_if(const LiftLowerContext &cx, bool condition, const char *message = nullptr) noexcept(false)
82
{
83
- if (!condition)
+ if (condition)
84
85
- return;
86
- }
87
-
88
- const char *msg = message == nullptr ? "Unknown trap" : message;
89
- if (cx.trap)
90
- {
91
- cx.trap(msg);
92
+ const char *msg = message == nullptr ? "Unknown trap" : message;
+ if (cx.trap)
+ {
+ cx.trap(msg);
+ return;
+ }
+ throw std::runtime_error(msg);
93
}
94
- throw std::runtime_error(msg);
95
96
97
inline LiftLowerContext make_trap_context(const HostTrap &trap)
0 commit comments