From eea6a9320ee23f115a1e18ac2b032ff835249746 Mon Sep 17 00:00:00 2001 From: Sebastien Marchand Date: Fri, 18 Aug 2017 08:25:40 -0400 Subject: [PATCH] Fix a VS2017 compilation issue in wasm-js.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MSVC2017 build of Chrome fais with the following message: c:\src\chrome\src\out\debug\gen\base\trace_event\common\../../../../../../v8/src/wasm/wasm-js.cc(76): error C2872: 'byte': ambiguous symbol c:\src\chrome\src\out\debug\gen\base\trace_event\common\../../../../../../v8/src/wasm/wasm-js.cc(25): note: could be 'uint8_t byte' C:\src\chrome\src\v8\src/globals.h(141): note: or 'v8::internal::byte' Bug: chromium:683729 Change-Id: Icbc25cd1296d19b8c3942c5d968434ec03707c2f Reviewed-on: https://chromium-review.googlesource.com/617405 Reviewed-by: Ben Titzer Reviewed-by: Michael Achenbach Commit-Queue: Sébastien Marchand Cr-Commit-Position: refs/heads/master@{#47428} --- src/wasm/wasm-js.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc index 4b8c00e326..ddbe1c36fa 100644 --- a/src/wasm/wasm-js.cc +++ b/src/wasm/wasm-js.cc @@ -22,8 +22,6 @@ #include "src/wasm/wasm-objects.h" #include "src/wasm/wasm-result.h" -typedef uint8_t byte; - using v8::internal::wasm::ErrorThrower; namespace v8 { @@ -73,7 +71,7 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes( return i::wasm::ModuleWireBytes(nullptr, nullptr); } - const byte* start = nullptr; + const uint8_t* start = nullptr; size_t length = 0; v8::Local source = args[0]; if (source->IsArrayBuffer()) { @@ -81,7 +79,7 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes( Local buffer = Local::Cast(source); ArrayBuffer::Contents contents = buffer->GetContents(); - start = reinterpret_cast(contents.Data()); + start = reinterpret_cast(contents.Data()); length = contents.ByteLength(); } else if (source->IsTypedArray()) { // A TypedArray was passed. @@ -91,7 +89,7 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes( ArrayBuffer::Contents contents = buffer->GetContents(); start = - reinterpret_cast(contents.Data()) + array->ByteOffset(); + reinterpret_cast(contents.Data()) + array->ByteOffset(); length = array->ByteLength(); } else { thrower->TypeError("Argument 0 must be a buffer source");