Fix MSVC error in WasmModuleBuilder::AddExport().

In a DCHECK inside AddExport(), MSVC gives a C4018 signed/unsigned
mismatch warning. Use a cast to silence this.

Change-Id: Ie388b95b183d2ca3649475fe2206171800673f88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1697043
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62636}
This commit is contained in:
Lei Zhang 2019-07-10 20:50:51 -07:00 committed by Commit Bot
parent 032176246f
commit 27ed9b4382

View File

@ -306,7 +306,7 @@ void WasmModuleBuilder::MarkStartFunction(WasmFunctionBuilder* function) {
void WasmModuleBuilder::AddExport(Vector<const char> name,
WasmFunctionBuilder* function) {
DCHECK(function->func_index() <= std::numeric_limits<int>::max());
DCHECK_LE(function->func_index(), std::numeric_limits<int>::max());
function_exports_.push_back({name, static_cast<int>(function->func_index())});
}