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

Commit bb03b362 authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar Committed by Gerrit Code Review
Browse files

Merge "Ignore deliberate free() of non-heap memory"

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


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

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


noinline void leak() {
noinline void leak() {
    while (true) {
    while (true) {