Avoid out-of-bounds reads from blas_quick_divide_table on big systems
This commit is contained in:
parent
26ce518d46
commit
8145ecd70b
|
@ -179,6 +179,10 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
if ( y > 64) {
|
||||||
|
result = x/y;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
y = blas_quick_divide_table[y];
|
y = blas_quick_divide_table[y];
|
||||||
|
|
||||||
__asm__ __volatile__ ("mull %0" :"=d" (result) :"a"(x), "0" (y));
|
__asm__ __volatile__ ("mull %0" :"=d" (result) :"a"(x), "0" (y));
|
||||||
|
|
Loading…
Reference in New Issue