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

Commit abf347cc authored by Ivan Lozano's avatar Ivan Lozano
Browse files

Fix libui Region::validate() overflow aborts.

This disables the signed integer overflow sanitizer in getWidth,
getHeight, and getBounds. The overflows in these are expected and
benign. Disabling this should fix the aborts we were seeing in
Region::validate(). These functions are inline, so they don't show
up in the stack trace.

Bug: 69963030
Test: Compiles.
Change-Id: I85b43c166339e6c210f7d8f18d1661746efeada7
parent 95f40fb2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -86,15 +86,18 @@ public:
    }

    // rectangle's width
    __attribute__((no_sanitize("signed-integer-overflow")))
    inline int32_t getWidth() const {
        return right - left;
    }

    // rectangle's height
    __attribute__((no_sanitize("signed-integer-overflow")))
    inline int32_t getHeight() const {
        return bottom - top;
    }

    __attribute__((no_sanitize("signed-integer-overflow")))
    inline Rect getBounds() const {
        return Rect(right - left, bottom - top);
    }