Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bd1019c authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar Committed by Automerger Merge Worker
Browse files

Merge "Ignore deliberate free() of non-heap memory" am: bb03b362 am: 79ae0e1d am: ce9309f5

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1640702

Change-Id: I2b397e8a4f48500d5fde14becca008e5a6c191f5
parents 742203a9 ce9309f5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ cc_defaults {
        "-Werror",
        "-O0",
        "-fstack-protector-all",
        "-Wno-free-nonheap-object",
        "-Wno-date-time",
    ],
    srcs: ["crasher.cpp"],
+4 −0
Original line number Diff line number Diff line
@@ -134,10 +134,14 @@ noinline int crash(int a) {
    return a*2;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfree-nonheap-object"

noinline void abuse_heap() {
    char buf[16];
    free(buf); // GCC is smart enough to warn about this, but we're doing it deliberately.
}
#pragma clang diagnostic pop

noinline void leak() {
    while (true) {