Commit 5814e68d authored by Manish Jethani's avatar Manish Jethani Committed by Commit Bot

Ignore any selectors at index 8192 or beyond

Since the selector index field in RuleData is only 13 bits, we can only
support lookups in the range 0-8191. We must ignore any selectors
outside this range.

BUG=804179,632009

Change-Id: I11c0acfe27813d98f24f72fb7e50f13b326a0e84
Reviewed-on: https://chromium-review.googlesource.com/883702Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Manish Jethani <m.jethani@eyeo.com>
Cr-Commit-Position: refs/heads/master@{#531931}
parent 3922f113
......@@ -222,6 +222,11 @@ bool RuleSet::FindBestRuleSetAndAdd(const CSSSelector& component,
void RuleSet::AddRule(StyleRule* rule,
unsigned selector_index,
AddRuleFlags add_rule_flags) {
// The selector index field in RuleData is only 13 bits so we can't support
// selectors at index 8192 or beyond.
// See https://crbug.com/804179
if (selector_index >= 8192)
return;
RuleData rule_data(rule, selector_index, rule_count_++, add_rule_flags);
if (features_.CollectFeaturesFromRuleData(rule_data) ==
RuleFeatureSet::kSelectorNeverMatches)
......
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