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

Unified Diff: runtime/szrt_asan.c

Issue 2101173002: Added tests for bug detection on locals (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixed test file comment Created 4 years, 6 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 | « no previous file | tests_lit/asan_tests/errors.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/szrt_asan.c
diff --git a/runtime/szrt_asan.c b/runtime/szrt_asan.c
index 6fab295879818dfe1684f236223cbb78a04e2ee2..7a056c459926f7ab78cad50e96b0772591d241df 100644
--- a/runtime/szrt_asan.c
+++ b/runtime/szrt_asan.c
@@ -79,7 +79,10 @@ void __asan_check(char *ptr, int size) {
for (; ptr < end; ++ptr) {
char shadow = *(char *)MEM2SHADOW(ptr);
printf("checking %p with shadow %d\n", ptr, shadow);
- assert(shadow == 0 || (shadow > 0 && SHADOW_OFFSET(ptr) <= shadow));
+ if (shadow != 0 && (shadow < 0 || SHADOW_OFFSET(ptr) > shadow)) {
+ fprintf(stderr, "Illegal access of %d bytes at %p\n", size, ptr);
+ abort();
+ }
}
}
« no previous file with comments | « no previous file | tests_lit/asan_tests/errors.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698