From fec726e7e54890fbff35f9f47d21a32a51d406f5 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 28 Jul 2017 20:08:21 +0900 Subject: [PATCH] evas legacy event mask - cast to unit64_t before bitshift this fixes a bit wraparound in the shift as the 1 is an int (32bit) type that then gets shifted .. then after that cast to 64bit. found by PVS studio @fix --- src/lib/evas/canvas/evas_callbacks.c | 2 +- src/lib/evas/include/evas_inline.x | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index a6f3ee4..184b500 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -708,7 +708,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event) } else if ((type = _legacy_evas_callback_type(array[i].desc)) != EVAS_CALLBACK_LAST) { - obj->callback_mask |= (1 << type); + obj->callback_mask |= (((uint64_t)1) << type); } } } diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 3093a94..f17e8b3 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -47,7 +47,7 @@ _evas_object_event_new(void) static inline Eina_Bool _evas_object_callback_has_by_type(Evas_Object_Protected_Data *obj, Evas_Callback_Type type) { - return (obj->callback_mask & (1 << type)) != 0; + return (obj->callback_mask & (((uint64_t)1) << type)) != 0; } static inline int -- 2.7.4