Commit 305d2889 authored by Jungshik Shin (jungshik at google)'s avatar Jungshik Shin (jungshik at google)
Browse files

Merge a bidi fix to ICU's M42 branch

The following two changes are cherry-picked along with the corresponding
patch file (bidi.patch) and update for README.chromium.

http://crrev.com/7c81740601355556e630da515b74d889ba2f8d08/source/common/ubidi.c
http://crrev.com/7c81740601355556e630da515b74d889ba2f8d08/source/common/ubidiimp.h

DEPS in M42 will be updated to include this change.

BUG=451799
TEST=none
TBR=inferno@chromium.org

Review URL: https://codereview.chromium.org/1004743003
No related merge requests found
Showing with 40 additions and 5 deletions
+40 -5
......@@ -248,4 +248,7 @@ This directory contains the source code of ICU 54.1 for C/C++.
12. Fix a bug in BiDi
- patches/bidi.patch
- upstream bug: http://bugs.icu-project.org/trac/ticket/11177
- upstream bugs
http://bugs.icu-project.org/trac/ticket/11177
http://bugs.icu-project.org/trac/ticket/11451
diff --git a/source/common/ubidi.c b/source/common/ubidi.c
index 8c0d64b..e773de7 100644
index 8c0d64b..c43c41c 100644
--- a/source/common/ubidi.c
+++ b/source/common/ubidi.c
@@ -1,7 +1,7 @@
......@@ -11,6 +11,15 @@ index 8c0d64b..e773de7 100644
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -2138,7 +2138,7 @@ resolveImplicitLevels(UBiDi *pBiDi,
/* The isolates[] entries contain enough information to
resume the bidi algorithm in the same state as it was
when it was interrupted by an isolate sequence. */
- if(dirProps[start]==PDI) {
+ if(dirProps[start]==PDI && pBiDi->isolateCount >= 0) {
levState.startON=pBiDi->isolates[pBiDi->isolateCount].startON;
start1=pBiDi->isolates[pBiDi->isolateCount].start1;
stateImp=pBiDi->isolates[pBiDi->isolateCount].stateImp;
@@ -2340,7 +2340,7 @@ setParaSuccess(UBiDi *pBiDi) {
static void
setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
......@@ -36,3 +45,26 @@ index 8c0d64b..e773de7 100644
pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY;
}
diff --git a/source/common/ubidiimp.h b/source/common/ubidiimp.h
index 20ab9b9..14d7b99 100644
--- a/source/common/ubidiimp.h
+++ b/source/common/ubidiimp.h
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 1999-2014, International Business Machines
+* Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -184,8 +184,8 @@ typedef struct BracketData {
typedef struct Isolate {
int32_t startON;
int32_t start1;
+ int32_t state;
int16_t stateImp;
- int16_t state;
} Isolate;
typedef struct Run {
......@@ -2138,7 +2138,7 @@ resolveImplicitLevels(UBiDi *pBiDi,
/* The isolates[] entries contain enough information to
resume the bidi algorithm in the same state as it was
when it was interrupted by an isolate sequence. */
if(dirProps[start]==PDI) {
if(dirProps[start]==PDI && pBiDi->isolateCount >= 0) {
levState.startON=pBiDi->isolates[pBiDi->isolateCount].startON;
start1=pBiDi->isolates[pBiDi->isolateCount].start1;
stateImp=pBiDi->isolates[pBiDi->isolateCount].stateImp;
......
/*
******************************************************************************
*
* Copyright (C) 1999-2014, International Business Machines
* Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
......@@ -184,8 +184,8 @@ typedef struct BracketData {
typedef struct Isolate {
int32_t startON;
int32_t start1;
int32_t state;
int16_t stateImp;
int16_t state;
} Isolate;
typedef struct Run {
......
Supports Markdown
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