cppgc: Fix compilation error on gcc

Without the cast, gcc might throw the following error
during compilation:

error: enumeral mismatch in conditional expression:
'cppgc::internal::StatsCollector::ScopeId' vs
'cppgc::internal::StatsCollector::ConcurrentScopeId'

Change-Id: I95e230310a0cbdc775d63657b8c407a8392a57e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2551104
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71325}
This commit is contained in:
Milad Fa 2020-11-20 14:19:19 -05:00 committed by Commit Bot
parent f121194c51
commit e9d1e6b16b

View File

@ -147,9 +147,10 @@ class V8_EXPORT_PRIVATE StatsCollector final {
start_time_(v8::base::TimeTicks::Now()),
scope_id_(scope_id) {
DCHECK_LE(0, scope_id_);
DCHECK_LT(scope_id_, scope_category == kMutatorThread
? kNumScopeIds
: kNumConcurrentScopeIds);
DCHECK_LT(static_cast<int>(scope_id_),
scope_category == kMutatorThread
? static_cast<int>(kNumScopeIds)
: static_cast<int>(kNumConcurrentScopeIds));
StartTrace(args...);
}