Changeset 27283 in vbox for trunk/src/VBox
- Timestamp:
- Mar 11, 2010 1:42:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp
r27270 r27283 33 33 *******************************************************************************/ 34 34 #include <iprt/mem.h> 35 36 #include <iprt/asm.h> 37 #include <iprt/initterm.h> 35 38 #include <iprt/stream.h> 36 #include <iprt/initterm.h>37 39 #include <iprt/string.h> 38 40 … … 46 48 static int tstMemAllocEfAccess() 47 49 { 48 char sz[1];49 int32_t v;50 51 50 /* Trivial alloc fence test - allocate a single word and access both 52 51 * the word after the allocated block and the word before. One of them … … 55 54 RTPrintf("tstRTMemAllocEfAccess: allocated int32_t at %#p\n", p); 56 55 RTPrintf("tstRTMemAllocEfAccess: triggering buffer overrun...\n"); 57 v = *(p + 1); 58 /* Dummy use of v so that the compiler cannot optimize it out */ 59 RTStrPrintf(sz, 0, "", v); 56 ASMProbeReadByte(p + 1); 60 57 RTPrintf("tstRTMemAllocEfAccess: triggering buffer underrun...\n"); 61 v = *(p - 1); 62 /* Dummy use of v so that the compiler cannot optimize it out */ 63 RTStrPrintf(sz, 0, "", v); 58 ASMProbeReadByte((char *)p - 1); 64 59 65 60 /* Reaching this is a severe error. */
Note:
See TracChangeset
for help on using the changeset viewer.