| Index: hax/haxlib.cc
|
| diff --git a/hax/haxlib.cc b/hax/haxlib.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..75f77abe7c1bfbe7a34d816d7d7eb5ef217de420
|
| --- /dev/null
|
| +++ b/hax/haxlib.cc
|
| @@ -0,0 +1,14 @@
|
| +#include "base/logging.h"
|
| +#include "base/process/memory.h"
|
| +
|
| +extern "C" void __attribute__((visibility("default"))) Hax() {
|
| + void* ptr;
|
| +
|
| + // Normal malloc/free - no problems
|
| + ptr = malloc(64);
|
| + free(ptr);
|
| +
|
| + // Unchecked malloc/free - problems!
|
| + CHECK(base::UncheckedMalloc(42, &ptr));
|
| + free(ptr);
|
| +}
|
|
|