Commit 56eb0cdb authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Fix 64 bit truncations in platform

SafeCast a sequence to int in bindings.
Add explicit cast in heap_page.h

BUG=879657

Change-Id: I1c6cf9b1748b84795ed81d903e3e19684bd6d0e3
Reviewed-on: https://chromium-review.googlesource.com/c/1354062Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611814}
parent 5de5c9c1
......@@ -19,6 +19,7 @@
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "v8/include/v8.h"
namespace blink {
......@@ -292,7 +293,7 @@ inline v8::Local<v8::Value> ToV8SequenceInternal(
v8::Local<v8::Array> array;
{
v8::Context::Scope context_scope(creation_context->CreationContext());
array = v8::Array::New(isolate, sequence.size());
array = v8::Array::New(isolate, SafeCast<int>(sequence.size()));
}
v8::Local<v8::Context> context = isolate->GetCurrentContext();
uint32_t index = 0;
......
......@@ -1121,7 +1121,8 @@ NO_SANITIZE_ADDRESS inline HeapObjectHeader::HeapObjectHeader(
DCHECK(gc_info_index < GCInfoTable::kMaxIndex);
DCHECK_LT(size, kNonLargeObjectPageSizeMax);
DCHECK(!(size & kAllocationMask));
encoded_ = uint32_t{(gc_info_index << kHeaderGCInfoIndexShift) | size};
encoded_ =
static_cast<uint32_t>((gc_info_index << kHeaderGCInfoIndexShift) | size);
if (header_location == kNormalPage) {
DCHECK(!PageFromObject(this)->IsLargeObjectPage());
static_cast<NormalPage*>(PageFromObject(this))
......
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