Commit e9d60225 authored by Sylvestre Ledru's avatar Sylvestre Ledru Committed by Jakob Gruber

Remove a useless declaration: preload_characters cannot be > 4 as we have a Min() above

Bug: 
Change-Id: I553d6481a485a87c0246424270d63297400ceabe
Reviewed-on: https://chromium-review.googlesource.com/579909Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49476}
parent e7551913
......@@ -131,6 +131,7 @@ Sandro Santilli <strk@keybit.net>
Sanjoy Das <sanjoy@playingwithpointers.com>
Seo Sanghyeon <sanxiyn@gmail.com>
Stefan Penner <stefan.penner@gmail.com>
Sylvestre Ledru <sledru@mozilla.com>
Tobias Burnus <burnus@net-b.de>
Victor Costan <costan@gmail.com>
Vlad Burlik <vladbph@gmail.com>
......
......@@ -3469,10 +3469,10 @@ void LoopChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
int eats_at_least) {
int preload_characters = Min(4, eats_at_least);
DCHECK_LE(preload_characters, 4);
if (compiler->macro_assembler()->CanReadUnaligned()) {
bool one_byte = compiler->one_byte();
if (one_byte) {
if (preload_characters > 4) preload_characters = 4;
// We can't preload 3 characters because there is no machine instruction
// to do that. We can't just load 4 because we could be reading
// beyond the end of the string, which could cause a memory fault.
......
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