Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: src/IceASanInstrumentation.cpp

Issue 2211733002: Subzero: Improved quality of ASan error messages (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Replaced switch statements with table lookups Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/alignment.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceASanInstrumentation.cpp
diff --git a/src/IceASanInstrumentation.cpp b/src/IceASanInstrumentation.cpp
index e3203b36225ed5b4fa6cdc7799f079dd9ee5c2b6..1aa1730699fa6cb2024526383276a43e400d355e 100644
--- a/src/IceASanInstrumentation.cpp
+++ b/src/IceASanInstrumentation.cpp
@@ -36,6 +36,7 @@ constexpr SizeT RzSize = 32;
constexpr const char *RzPrefix = "__$rz";
constexpr const char *RzArrayName = "__$rz_array";
constexpr const char *RzSizesName = "__$rz_sizes";
+constexpr char RzStackPoison = -1;
const llvm::NaClBitcodeRecord::RecordVector RzContents =
llvm::NaClBitcodeRecord::RecordVector(RzSize, 'R');
@@ -202,15 +203,17 @@ void ASanInstrumentation::instrumentFuncStart(LoweringContext &Context) {
constexpr SizeT NumArgs = 2;
constexpr Variable *Void = nullptr;
constexpr bool NoTailcall = false;
+ auto *RzSizeConst = ConstantInteger32::create(Ctx, IceType_i32, RzPadding);
+ auto *RzPoisonConst =
+ ConstantInteger32::create(Ctx, IceType_i32, RzStackPoison);
auto *Init = InstCall::create(Func, NumArgs, Void, InitFunc, NoTailcall);
+ Init->addArg(RzLocVar);
+ Init->addArg(RzSizeConst);
+ Init->addArg(RzPoisonConst);
auto *Destroy =
InstCall::create(Func, NumArgs, Void, DestroyFunc, NoTailcall);
- Init->addArg(RzLocVar);
Destroy->addArg(RzLocVar);
- auto *RzSizeConst = ConstantInteger32::create(Ctx, IceType_i32, RzPadding);
- Init->addArg(RzSizeConst);
Destroy->addArg(RzSizeConst);
-
Cur->setDeleted();
C.insert(NewVar);
ICE_TLS_GET_FIELD(LocalDtors)->emplace_back(Destroy);
@@ -234,14 +237,16 @@ void ASanInstrumentation::instrumentFuncStart(LoweringContext &Context) {
constexpr SizeT NumArgs = 2;
constexpr Variable *Void = nullptr;
constexpr bool NoTailcall = false;
+ auto *RzPoisonConst =
+ ConstantInteger32::create(Ctx, IceType_i32, RzStackPoison);
auto *Init = InstCall::create(Func, NumArgs, Void, InitFunc, NoTailcall);
+ Init->addArg(LastRz);
+ Init->addArg(RzAlloca->getSizeInBytes());
+ Init->addArg(RzPoisonConst);
auto *Destroy =
InstCall::create(Func, NumArgs, Void, DestroyFunc, NoTailcall);
- Init->addArg(LastRz);
Destroy->addArg(LastRz);
- Init->addArg(RzAlloca->getSizeInBytes());
Destroy->addArg(RzAlloca->getSizeInBytes());
-
ICE_TLS_GET_FIELD(LocalDtors)->emplace_back(Destroy);
C.insert(RzAlloca);
C.insert(Init);
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/alignment.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698