Merge pull request #495 from jeromerobert/develop
Fix a segfault in gemv when MAX_STACK_ALLOC is set
This commit is contained in:
commit
07ff001981
|
@ -209,7 +209,9 @@ void CNAME(enum CBLAS_ORDER order,
|
|||
if (incy < 0) y -= (leny - 1) * incy;
|
||||
|
||||
#ifdef MAX_STACK_ALLOC
|
||||
int stack_alloc_size = m + n;
|
||||
// make it volatile because some gemv implementation (ex: dgemv_n.S)
|
||||
// do not restore all register
|
||||
volatile int stack_alloc_size = m + n;
|
||||
if(stack_alloc_size < 128)
|
||||
//dgemv_n.S require a 128 bytes buffer
|
||||
stack_alloc_size = 128;
|
||||
|
|
|
@ -172,7 +172,7 @@ void CNAME(enum CBLAS_ORDER order,
|
|||
if (incx < 0) x -= (m - 1) * incx;
|
||||
|
||||
#ifdef MAX_STACK_ALLOC
|
||||
int stack_alloc_size = m;
|
||||
volatile int stack_alloc_size = m;
|
||||
if(stack_alloc_size > MAX_STACK_ALLOC / sizeof(FLOAT))
|
||||
stack_alloc_size = 0;
|
||||
FLOAT stack_buffer[stack_alloc_size];
|
||||
|
|
Loading…
Reference in New Issue