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

Side by Side Diff: hax/haxlib.cc

Issue 2269013002: example failure for UncheckedMalloc + DSO Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Linker script Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « hax/hax.lst ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "base/logging.h"
2 #include "base/process/memory.h"
3
4 extern "C" void* tc_malloc();
5
6 extern "C" void __attribute__((visibility("default"))) Hax() {
7 void* ptr;
8
9 printf("DSO malloc: %p\n", &malloc);
10 printf("DSO tc_malloc: %p\n", &tc_malloc);
11 printf("DSO free: %p\n", &free);
12 printf("DSO UncheckedMalloc: %p\n", &base::UncheckedMalloc);
13
14 // Normal malloc/free - no problems
15 ptr = malloc(64);
16 free(ptr);
17
18 // Unchecked malloc/free - problems!
19 CHECK(base::UncheckedMalloc(42, &ptr));
20 free(ptr);
21 }
OLDNEW
« no previous file with comments | « hax/hax.lst ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698