projects
/
platform
/
upstream
/
openblas.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ab5bf1
)
Avoid out of bounds reads from blas_quick_divide_table on big systems
author
Martin Kroeker
<martin@ruby.chemie.uni-freiburg.de>
Sun, 29 Apr 2018 12:34:33 +0000
(14:34 +0200)
committer
GitHub
<noreply@github.com>
Sun, 29 Apr 2018 12:34:33 +0000
(14:34 +0200)
Should fix #1541
common_x86_64.h
patch
|
blob
|
history
diff --git
a/common_x86_64.h
b/common_x86_64.h
index
bee88d3
..
0542653
100644
(file)
--- a/
common_x86_64.h
+++ b/
common_x86_64.h
@@
-195,7
+195,9
@@
static __inline int blas_quickdivide(unsigned int x, unsigned int y){
unsigned int result;
if (y <= 1) return x;
-
+
+ if (y > 64) return x/y;
+
y = blas_quick_divide_table[y];
__asm__ __volatile__ ("mull %0" :"=d" (result) :"a"(x), "0" (y));