Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
MIPS64: [regexp] do not assume short external strings have a minimum …
Browse files Browse the repository at this point in the history
…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}
  • Loading branch information
Ilija.Pavlovic authored and Commit bot committed Apr 21, 2016
1 parent 5e11acc commit 71dd5c4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/mips64/code-stubs-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1683,11 +1683,8 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
__ ld(subject, MemOperand(sp, kSubjectOffset));
__ JumpIfSmi(subject, &runtime);
__ mov(a3, subject); // Make a copy of the original subject string.
__ ld(a0, FieldMemOperand(subject, HeapObject::kMapOffset));
__ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset));

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

__ bind(&check_underlying);
__ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset));
__ Daddu(a0, a2, Map::kInstanceTypeOffset);
__ lbu(a0, MemOperand(a0));
__ lbu(a0, FieldMemOperand(a2, Map::kInstanceTypeOffset));

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

0 comments on commit 71dd5c4

Please sign in to comment.