forked from enlightenment/efl
eina: check the type before looking at anything else to avoid triggering valgrind warning.
This commit is contained in:
parent
e4a6aaa4c1
commit
671fc92f08
|
@ -538,11 +538,10 @@ eina_value_pget(const Eina_Value *value, void *ptr)
|
||||||
static inline const Eina_Value_Type *
|
static inline const Eina_Value_Type *
|
||||||
eina_value_type_get(const Eina_Value *value)
|
eina_value_type_get(const Eina_Value *value)
|
||||||
{
|
{
|
||||||
const Eina_Value empty = EINA_VALUE_EMPTY;
|
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
|
||||||
// Trigger warning if the type is NULL, but the value is != EINA_VALUE_EMTPY.
|
// Trigger warning if the type is NULL, but the value is != EINA_VALUE_EMTPY.
|
||||||
if (memcmp(value, &empty, sizeof (Eina_Value)))
|
if (!value->type &&
|
||||||
|
value->value._guarantee)
|
||||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), NULL);
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), NULL);
|
||||||
return value->type;
|
return value->type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue