Commit bdf669be authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][traphandler] Remove errorneous enable_if

The type std::enable_if<cond> does always exist, it only makes sense to
check for std::enable_if<cond>::type. But the way this is used here we
also cannot do that, so just replace this by a good old "#ifdef DEBUG".

Drive-by: Minor unrelated cleanup (constexpr and ifdef).

R=eholk@chromium.org

Change-Id: I6bc27ee3adfd3ec3d38d61df67dd9cdff0faf2f7
Reviewed-on: https://chromium-review.googlesource.com/939387Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51612}
parent 0365493a
......@@ -34,10 +34,10 @@
namespace {
size_t gNextCodeObject = 0;
#if defined(DEBUG)
const bool kEnableDebug = true;
#ifdef DEBUG
constexpr bool kEnableDebug = true;
#else
const bool kEnableDebug = false;
constexpr bool kEnableDebug = false;
#endif
}
......@@ -54,7 +54,7 @@ constexpr size_t HandlerDataSize(size_t num_protected_instructions) {
}
namespace {
template <typename = std::enable_if<kEnableDebug>>
#ifdef DEBUG
bool IsDisjoint(const CodeProtectionInfo* a, const CodeProtectionInfo* b) {
if (a == nullptr || b == nullptr) {
return true;
......@@ -65,6 +65,7 @@ bool IsDisjoint(const CodeProtectionInfo* a, const CodeProtectionInfo* b) {
return a_base >= b_base + b->size || b_base >= a_base + a->size;
}
#endif
// Verify that the code range does not overlap any that have already been
// registered.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment