stack alloc: Fix stack smashing detection in 32bits

* Fix commit 87a2ccc
* Close #736
This commit is contained in:
Jerome Robert 2016-01-10 19:04:37 +01:00
parent c6a27bbe64
commit 708ad330ac
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef STACK_ALLOC_PROTECT
// Try to detect stack smashing
#include <assert.h>
#define STACK_ALLOC_PROTECT_SET volatile BLASLONG stack_check = 0x7ff8010203040506;
#define STACK_ALLOC_PROTECT_CHECK assert(stack_check == 0x7ff8010203040506);
#define STACK_ALLOC_PROTECT_SET volatile int stack_check = 0x7fc01234;
#define STACK_ALLOC_PROTECT_CHECK assert(stack_check == 0x7fc01234);
#else
#define STACK_ALLOC_PROTECT_SET
#define STACK_ALLOC_PROTECT_CHECK