Do not use out of range visitor ids.
BUG= Review URL: https://codereview.chromium.org/822693002 Cr-Commit-Position: refs/heads/master@{#25920}
This commit is contained in:
parent
c61abc1426
commit
892f6c7127
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user