[llvm-commits] [poolalloc] r131712 - in /poolalloc/trunk: lib/AssistDS/TypeChecks.cpp runtime/DynamicTypeChecks/TypeRuntime.c
Arushi Aggarwal
aggarwa4 at illinois.edu
Thu May 19 18:56:38 PDT 2011
Author: aggarwa4
Date: Thu May 19 20:56:38 2011
New Revision: 131712
URL: http://llvm.org/viewvc/llvm-project?rev=131712&view=rev
Log:
Copy types over on an strcpy call.
Modified:
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=131712&r1=131711&r2=131712&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Thu May 19 20:56:38 2011
@@ -906,6 +906,13 @@
CallInst::Create(F, Args.begin(), Args.end(), "", I);
return true;
}
+ } else if (F->getNameStr() == std::string("strcpy")) {
+ std::vector<Value *> Args;
+ Args.push_back(I->getOperand(1));
+ Args.push_back(I->getOperand(2));
+ Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
+ Constant *F = M.getOrInsertFunction("trackStrcpyInst", VoidTy, VoidPtrTy, VoidPtrTy, Int32Ty, NULL);
+ CallInst::Create(F, Args.begin(), Args.end(), "", I);
} else if(F->getNameStr() == std::string("ftime")) {
if(EnableTypeSafeOpt) {
if(TS->isTypeSafe(I->getOperand(1), I->getParent()->getParent())) {
Modified: poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c?rev=131712&r1=131711&r2=131712&view=diff
==============================================================================
--- poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c (original)
+++ poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c Thu May 19 20:56:38 2011
@@ -200,3 +200,7 @@
printf("Copy: %p, %p = %u | %" PRIu64 " bytes | %u\n", dstptr, (void *)d, shadow_begin[s], size, tag);
#endif
}
+
+void trackStrcpyInst(void *dst, void *src, uint32_t tag) {
+ copyTypeInfo(dst, src, strlen(src), tag);
+}
More information about the llvm-commits
mailing list