diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-10-09 13:00:35 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-10-15 13:15:46 -0700 |
commit | fc11d2e872bfcfbd07b4f81114e0336d10650b84 (patch) | |
tree | 007b753eb8a73012d7804dc4edad61b0eebe28bc /scripts/vendor | |
parent | 6cbf150a3391c87d895222b2b1ddc2046ccc8dad (diff) | |
download | qtlocation-mapboxgl-fc11d2e872bfcfbd07b4f81114e0336d10650b84.tar.gz |
[core, test] Add BiDi unit test
- Port of arabic.test.js from mapbox-gl-rtl-text
- Modify BiDi::getLine to remove trailing nulls in the event UBIDI_REMOVE_BIDI_CONTROLS causes the string to shorten.
- Patch vendored ICU to avoid undefined undefined bit shifting behavior (triggered sanitizer failure)
Diffstat (limited to 'scripts/vendor')
-rwxr-xr-x | scripts/vendor/icu.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/vendor/icu.sh b/scripts/vendor/icu.sh index 8ee9cd76fb..7a2c635080 100755 --- a/scripts/vendor/icu.sh +++ b/scripts/vendor/icu.sh @@ -49,6 +49,24 @@ for FILE in "${ALL[@]}"; do sed 's/^#include \"\(unicode\/[^\"]\{1,\}\)\"/#include <\1>/' "common/$FILE" > "$DIR/$FILE" done +# Apply patch from https://github.com/LibreOffice/core/blob/master/external/icu/icu4c-ubsan.patch.1 +# Shifting signed int to a number greater than can be represented is undefined behavior +patch -p0 << PATCH +--- src/ubidiimp.h ++++ src/ubidiimp.h +@@ -198,8 +198,8 @@ + /* in a Run, logicalStart will get this bit set if the run level is odd */ + #define INDEX_ODD_BIT (1UL<<31) + +-#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31)) ++#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31)) +-#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31)) ++#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31)) + #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT) + + #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT) +PATCH + rm -rf common file_list include src -name "*.h" -o -name "*.cpp" |