Fix a VS2017 compilation issue in wasm-js.cc
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 <titzer@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org> Cr-Commit-Position: refs/heads/master@{#47428}
This commit is contained in:
parent
b4a97a939a
commit
eea6a9320e
@ -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<v8::Value> source = args[0];
|
||||
if (source->IsArrayBuffer()) {
|
||||
@ -81,7 +79,7 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes(
|
||||
Local<ArrayBuffer> buffer = Local<ArrayBuffer>::Cast(source);
|
||||
ArrayBuffer::Contents contents = buffer->GetContents();
|
||||
|
||||
start = reinterpret_cast<const byte*>(contents.Data());
|
||||
start = reinterpret_cast<const uint8_t*>(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<const byte*>(contents.Data()) + array->ByteOffset();
|
||||
reinterpret_cast<const uint8_t*>(contents.Data()) + array->ByteOffset();
|
||||
length = array->ByteLength();
|
||||
} else {
|
||||
thrower->TypeError("Argument 0 must be a buffer source");
|
||||
|
Loading…
Reference in New Issue
Block a user