Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: src/heap/objects-visiting.h

Issue 822693002: Do not use out of range visitor ids. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting.h
diff --git a/src/heap/objects-visiting.h b/src/heap/objects-visiting.h
index f8c58dd8169f657bd0a223fbc6b4cab2caf2e1ef..a442867569606c1d4471a3ee2720a1fc89cf5b13 100644
--- a/src/heap/objects-visiting.h
+++ b/src/heap/objects-visiting.h
@@ -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);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698