Commit 892f6c71 authored by hpayer's avatar hpayer Committed by Commit bot

Do not use out of range visitor ids.

BUG=

Review URL: https://codereview.chromium.org/822693002

Cr-Commit-Position: refs/heads/master@{#25920}
parent c61abc14
......@@ -130,10 +130,11 @@ class StaticVisitorBase : public AllStatic {
if (has_unboxed_fields) return generic;
const VisitorId specialization = static_cast<VisitorId>(
base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords);
int visitor_id =
Min(base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords,
static_cast<int>(generic));
return Min(specialization, generic);
return static_cast<VisitorId>(visitor_id);
}
};
......
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