[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/939387 Reviewed-by: Eric Holk <eholk@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#51612}
This commit is contained in:
parent
0365493a95
commit
bdf669be07
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user