Skip to content

Commit 97cc0fc

Browse files
FarazmandBethGriggs
Farazmand
authored andcommittedMar 21, 2019
deps: V8: cherry-pick 3cc6919
Original commit message: PPC: fix Regex addi overflow using add insetad of addi when Operand is more than 16 bits long Change-Id: I7f9452381ed8b321ec71e68d0d90485508b69885 Reviewed-on: https://chromium-review.googlesource.com/c/1430619 Commit-Queue: Junliang Yan <jyan@ca.ibm.com> Reviewed-by: Junliang Yan <jyan@ca.ibm.com> Cr-Commit-Position: refs/heads/master@{#59049} Refs: v8/v8@3cc6919 PR-URL: #25874 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: George Adams <george.adams@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent 7573b55 commit 97cc0fc

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed
 

‎deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 414
14-
#define V8_PATCH_LEVEL 76
14+
#define V8_PATCH_LEVEL 77
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

‎deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc

+13-3
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,13 @@ int RegExpMacroAssemblerPPC::stack_limit_slack() {
142142

143143
void RegExpMacroAssemblerPPC::AdvanceCurrentPosition(int by) {
144144
if (by != 0) {
145-
__ addi(current_input_offset(), current_input_offset(),
146-
Operand(by * char_size()));
145+
if (is_int16(by * char_size())) {
146+
__ addi(current_input_offset(), current_input_offset(),
147+
Operand(by * char_size()));
148+
} else {
149+
__ mov(r0, Operand(by * char_size()));
150+
__ add(current_input_offset(), r0, current_input_offset());
151+
}
147152
}
148153
}
149154

@@ -1270,7 +1275,12 @@ void RegExpMacroAssemblerPPC::LoadCurrentCharacterUnchecked(int cp_offset,
12701275
Register offset = current_input_offset();
12711276
if (cp_offset != 0) {
12721277
// r25 is not being used to store the capture start index at this point.
1273-
__ addi(r25, current_input_offset(), Operand(cp_offset * char_size()));
1278+
if (is_int16(cp_offset * char_size())) {
1279+
__ addi(r25, current_input_offset(), Operand(cp_offset * char_size()));
1280+
} else {
1281+
__ mov(r25, Operand(cp_offset * char_size()));
1282+
__ add(r25, r25, current_input_offset());
1283+
}
12741284
offset = r25;
12751285
}
12761286
// The lwz, stw, lhz, sth instructions can do unaligned accesses, if the CPU

0 commit comments

Comments
 (0)
Please sign in to comment.