Commit d874e0dc authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[wasm] Remove dangerous ByteArray::data accessor.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2388303008
Cr-Commit-Position: refs/heads/master@{#40028}
parent 1411c762
......@@ -4059,10 +4059,6 @@ byte ByteArray::get(int index) {
return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
}
const byte* ByteArray::data() const {
return reinterpret_cast<const byte*>(FIELD_ADDR_CONST(this, kHeaderSize));
}
void ByteArray::set(int index, byte value) {
DCHECK(index >= 0 && index < this->length());
WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value);
......
......@@ -4726,7 +4726,6 @@ class ByteArray: public FixedArrayBase {
// Setter and getter.
inline byte get(int index);
inline void set(int index, byte value);
inline const byte* data() const;
// Copy in / copy out whole byte slices.
inline void copy_out(int index, byte* buffer, int length);
......
......@@ -514,8 +514,8 @@ Handle<Code> CompileImportWrapper(Isolate* isolate,
ByteArray::cast(func->GetInternalField(kInternalSignature)));
if (exported_param_count == param_count &&
exportedSig->length() == sig_data->length() &&
memcmp(exportedSig->data(), sig_data->data(),
exportedSig->length()) == 0) {
memcmp(exportedSig->GetDataStartAddress(),
sig_data->GetDataStartAddress(), exportedSig->length()) == 0) {
isMatch = true;
}
}
......@@ -540,7 +540,7 @@ Handle<Code> CompileImportWrapper(Isolate* isolate,
Zone zone(isolate->allocator());
MachineRepresentation* reps =
zone.NewArray<MachineRepresentation>(sig_data_size);
memcpy(reps, sig_data->data(),
memcpy(reps, sig_data->GetDataStartAddress(),
sizeof(MachineRepresentation) * sig_data_size);
FunctionSig sig(ret_count, param_count, reps);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment