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

Unified Diff: runtime/szrt_asan.c

Issue 2079723002: Instrumented malloc and free with dummy functions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 | src/IceASanInstrumentation.h » ('j') | src/IceASanInstrumentation.cpp » ('J')
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 db020f5968c856c2c9416a40cfc684be6d54e50f..47b6abc8c3a054e623cfbecb065c0cf5c08740a8 100644
--- a/runtime/szrt_asan.c
+++ b/runtime/szrt_asan.c
@@ -15,7 +15,8 @@
///
//===----------------------------------------------------------------------===//
-#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
// TODO(tlively): Define and implement this library
void __asan_init(void) {
@@ -24,6 +25,16 @@ void __asan_init(void) {
}
void __asan_check(void *addr, int size) {
- printf("Check access of %p of size %d\n", addr, size);
+ printf("Check %d bytes at %p\n", size, addr);
return;
}
+
+void *__asan_malloc(size_t size) {
+ printf("malloc() called with size %d\n", size);
+ return malloc(size);
+}
+
+void __asan_free(void *ptr) {
+ printf("free() called on %p\n", ptr);
+ free(ptr);
+}
« no previous file with comments | « no previous file | src/IceASanInstrumentation.h » ('j') | src/IceASanInstrumentation.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698