Changeset 27270 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 11, 2010 10:39:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp
r27269 r27270 46 46 static int tstMemAllocEfAccess() 47 47 { 48 char sz[1]; 48 49 int32_t v; 49 50 … … 52 53 * will crash no matter whether the fence is at the bottom or on top. */ 53 54 int32_t *p = (int32_t *)RTMemEfAlloc(sizeof(int32_t)); 54 RTPrintf("tstRTMemAllocEfAccess: allocated int32_t at %#p\n" );55 RTPrintf("tstRTMemAllocEfAccess: allocated int32_t at %#p\n", p); 55 56 RTPrintf("tstRTMemAllocEfAccess: triggering buffer overrun...\n"); 56 57 v = *(p + 1); 58 /* Dummy use of v so that the compiler cannot optimize it out */ 59 RTStrPrintf(sz, 0, "", v); 57 60 RTPrintf("tstRTMemAllocEfAccess: triggering buffer underrun...\n"); 58 61 v = *(p - 1); 62 /* Dummy use of v so that the compiler cannot optimize it out */ 63 RTStrPrintf(sz, 0, "", v); 59 64 60 65 /* Reaching this is a severe error. */ 61 return VERR_GENERAL_FAILURE;66 return 0; 62 67 } 63 68
Note:
See TracChangeset
for help on using the changeset viewer.