[scanner] Update outdated DCHECK
We recently changed uc32 to be an unsigned type, and with the invalid marker being static_cast<uc32>(-1) this DCHECK no longer holds. After this CL it expicitly checks for the invalid marker. Bug: v8:10568,chromium:1094226 Change-Id: Idd9efe055b38387e3e37b132cb786cca130767b3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2245592 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Auto-Submit: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#68333}
This commit is contained in:
parent
333c180451
commit
9aa3c608f4
@ -544,7 +544,8 @@ class V8_EXPORT_PRIVATE Scanner {
|
||||
}
|
||||
|
||||
void PushBack(uc32 ch) {
|
||||
DCHECK_LE(c0_, static_cast<uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode));
|
||||
DCHECK(IsInvalid(c0_) ||
|
||||
base::IsInRange(c0_, 0u, unibrow::Utf16::kMaxNonSurrogateCharCode));
|
||||
source_->Back();
|
||||
c0_ = ch;
|
||||
}
|
||||
|
5
test/mjsunit/regress/regress-1094226.js
Normal file
5
test/mjsunit/regress/regress-1094226.js
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright 2020 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
assertThrows(() => eval('<' + '!'));
|
Loading…
Reference in New Issue
Block a user