Loading media/libstagefright/foundation/include/media/stagefright/foundation/AData.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,10 @@ #undef HIDE #undef HIDE #define HIDE __attribute__((visibility("hidden"))) #define HIDE __attribute__((visibility("hidden"))) // The internals of AUnion cause problems with CFI #undef NO_CFI #define NO_CFI __attribute__((no_sanitize("cfi"))) namespace android { namespace android { /** /** Loading Loading @@ -93,7 +97,7 @@ struct HIDE _AUnion_impl { * \param args arbitrary arguments for constructor * \param args arbitrary arguments for constructor */ */ template<typename T, typename ...Args> template<typename T, typename ...Args> inline static void emplace(size_t totalSize, T *addr, Args&&... args) { inline static void NO_CFI emplace(size_t totalSize, T *addr, Args&&... args) { new(addr)T(std::forward<Args>(args)...); new(addr)T(std::forward<Args>(args)...); // clear slack space - this is not technically required // clear slack space - this is not technically required constexpr size_t size = sizeof(T); constexpr size_t size = sizeof(T); Loading Loading @@ -160,7 +164,7 @@ public: template< template< typename T, typename ...Args, typename T, typename ...Args, typename=typename std::enable_if<is_one_of<T, void, Ts...>::value>::type> typename=typename std::enable_if<is_one_of<T, void, Ts...>::value>::type> inline void emplace(Args&&... args) { inline void NO_CFI emplace(Args&&... args) { _AUnion_impl::emplace( _AUnion_impl::emplace( sizeof(_type), reinterpret_cast<T*>(&mValue), std::forward<Args>(args)...); sizeof(_type), reinterpret_cast<T*>(&mValue), std::forward<Args>(args)...); } } Loading Loading
media/libstagefright/foundation/include/media/stagefright/foundation/AData.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,10 @@ #undef HIDE #undef HIDE #define HIDE __attribute__((visibility("hidden"))) #define HIDE __attribute__((visibility("hidden"))) // The internals of AUnion cause problems with CFI #undef NO_CFI #define NO_CFI __attribute__((no_sanitize("cfi"))) namespace android { namespace android { /** /** Loading Loading @@ -93,7 +97,7 @@ struct HIDE _AUnion_impl { * \param args arbitrary arguments for constructor * \param args arbitrary arguments for constructor */ */ template<typename T, typename ...Args> template<typename T, typename ...Args> inline static void emplace(size_t totalSize, T *addr, Args&&... args) { inline static void NO_CFI emplace(size_t totalSize, T *addr, Args&&... args) { new(addr)T(std::forward<Args>(args)...); new(addr)T(std::forward<Args>(args)...); // clear slack space - this is not technically required // clear slack space - this is not technically required constexpr size_t size = sizeof(T); constexpr size_t size = sizeof(T); Loading Loading @@ -160,7 +164,7 @@ public: template< template< typename T, typename ...Args, typename T, typename ...Args, typename=typename std::enable_if<is_one_of<T, void, Ts...>::value>::type> typename=typename std::enable_if<is_one_of<T, void, Ts...>::value>::type> inline void emplace(Args&&... args) { inline void NO_CFI emplace(Args&&... args) { _AUnion_impl::emplace( _AUnion_impl::emplace( sizeof(_type), reinterpret_cast<T*>(&mValue), std::forward<Args>(args)...); sizeof(_type), reinterpret_cast<T*>(&mValue), std::forward<Args>(args)...); } } Loading