From: Carsten Haitzler (Rasterman) Date: Fri, 28 Jul 2017 11:08:21 +0000 (+0900) Subject: evas legacy event mask - cast to unit64_t before bitshift X-Git-Tag: upstream/1.20.0~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fec726e7e54890fbff35f9f47d21a32a51d406f5;p=platform%2Fupstream%2Fefl.git 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 --- 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