summaryrefslogtreecommitdiff
path: root/app-arch/bzip2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
commit43793fab84041cfc5c60c0151d1591b8a69fb24a (patch)
tree6208a7f4fc744684fce0f55acbb47511acace498 /app-arch/bzip2/files
parent28e3d252dc8ac8a5635206dfefe1cfe05058d1db (diff)
gentoo resync : 25.08.2018
Diffstat (limited to 'app-arch/bzip2/files')
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-ubsan-error.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-ubsan-error.patch b/app-arch/bzip2/files/bzip2-1.0.6-ubsan-error.patch
new file mode 100644
index 000000000000..84b811177ed5
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-ubsan-error.patch
@@ -0,0 +1,24 @@
+Author: Manoj Gupta <manojgupta@google.com>
+
+Use unsigned 1 for shifting instead of signed 1.
+
+This fixed an issue with shift caught by undefined behavior
+sanitizer in clang.
+bzip2-1.0.6/blocksort.c:255:7
+runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
+
+--- a/blocksort.c
++++ b/blocksort.c
+@@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap,
+ bhtab [ 0 .. 2+(nblock/32) ] destroyed
+ */
+
+-#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
+-#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
+-#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
++#define SET_BH(zz) bhtab[(zz) >> 5] |= (1u << ((zz) & 31))
++#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1u << ((zz) & 31))
++#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1u << ((zz) & 31)))
+ #define WORD_BH(zz) bhtab[(zz) >> 5]
+ #define UNALIGNED_BH(zz) ((zz) & 0x01f)
+