[llvm-commits] [poolalloc] r133796 - /poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Fri Jun 24 08:04:29 PDT 2011
Author: aggarwa4
Date: Fri Jun 24 10:04:29 2011
New Revision: 133796
URL: http://llvm.org/viewvc/llvm-project?rev=133796&view=rev
Log:
Use 0xFE to indicate the middle of an object, instead of 0xOO
Modified:
poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp
Modified: poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp?rev=133796&r1=133795&r2=133796&view=diff
==============================================================================
--- poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp (original)
+++ poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp Fri Jun 24 10:04:29 2011
@@ -139,7 +139,7 @@
void trackGlobal(void *ptr, TypeTagTy typeNumber, uint64_t size, uint32_t tag) {
uintptr_t p = maskAddress(ptr);
shadow_begin[p] = typeNumber;
- memset(&shadow_begin[p + 1], 0, size - 1);
+ memset(&shadow_begin[p + 1], 0xFE, size - 1);
#if DEBUG
cerr << "Global(" << tag << "): " << ptr << "= " << typeNumber << " " << size << "bytes\n";
#endif
@@ -165,7 +165,7 @@
void trackStoreInst(void *ptr, TypeTagTy typeNumber, uint64_t size, uint32_t tag) {
uintptr_t p = maskAddress(ptr);
shadow_begin[p] = typeNumber;
- memset(&shadow_begin[p + 1], 0, size - 1);
+ memset(&shadow_begin[p + 1], 0xFE, size - 1);
#if DEBUG
cerr << "Store(" << tag << "): " << ptr << "= " << typeNumber << " " << size << "bytes\n";
#endif
@@ -227,7 +227,7 @@
void
checkType(TypeTagTy typeNumber, uint64_t size, TypeTagTy *metadata, void *ptr, uint32_t tag) {
/* Check if this an initialized but untyped memory.*/
- if (typeNumber != metadata[0]) {
+ if (typeNumber != metadata[0] && metadata[0] != 0xFE) {
if (metadata[0] != 0xFF) {
printf("Type mismatch(%u): %p expecting %s, found %s!\n", tag, ptr, typeNames[typeNumber], typeNames[metadata[0]]);
return;
@@ -246,7 +246,7 @@
}
for (unsigned i = 1 ; i < size; ++i) {
- if (0 != metadata[i]) {
+ if (0xFE != metadata[i]) {
printf("Type alignment mismatch(%u): expecting %s, found %s!\n", tag, typeNames[typeNumber], typeNames[metadata[0]]);
break;
}
More information about the llvm-commits
mailing list