Skip to content

Commit 71dd5c4

Browse files
Ilija.PavlovicCommit bot
authored andcommitted
MIPS64: [regexp] do not assume short external strings have a minimum size.
Fix for execution tests on simulator. Port 3518e49 Original commit message: Short external strings do not cache the resource data, and may be used for compressible strings. The assumptions about their lengths is invalid and may lead to oob reads. BUG= Review URL: https://codereview.chromium.org/1904033003 Cr-Commit-Position: refs/heads/master@{#35703}
1 parent 5e11acc commit 71dd5c4

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/mips64/code-stubs-mips64.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,11 +1683,8 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
16831683
__ ld(subject, MemOperand(sp, kSubjectOffset));
16841684
__ JumpIfSmi(subject, &runtime);
16851685
__ mov(a3, subject); // Make a copy of the original subject string.
1686-
__ ld(a0, FieldMemOperand(subject, HeapObject::kMapOffset));
1687-
__ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset));
16881686

16891687
// subject: subject string
1690-
// a0: subject string instance type
16911688
// a3: subject string
16921689
// regexp_data: RegExp data (FixedArray)
16931690
// Handle subject string according to its encoding and representation:
@@ -1714,8 +1711,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
17141711

17151712
__ bind(&check_underlying);
17161713
__ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset));
1717-
__ Daddu(a0, a2, Map::kInstanceTypeOffset);
1718-
__ lbu(a0, MemOperand(a0));
1714+
__ lbu(a0, FieldMemOperand(a2, Map::kInstanceTypeOffset));
17191715

17201716
// (1) Sequential string? If yes, go to (4).
17211717
__ And(a1,

0 commit comments

Comments
 (0)