我有一个函数宏来检查,如果一个函数的返回值被检查
void *custom_get_value(ObjectPtr)
此功能传统上从未使用过返回NULL.It可以返回以下任何一个值的
uint32_t
int32_t
uint64_t
int64_t
uint8_t
由于函数从未使用返回NULL我有很多的代码,不会
*(uint32_t*)custom_get_value(ObjectPtr)
OR
*(uint64_t*)custom_get_value(ObjectPtr)
近日w^E具有决定修改的
void *custom_get_value(ObjectPtr) in such a way that it can return NULL.So all occourances of the above scenario (de-referencing to specific types without checking the return value) can result in segmentation fault.
我可以使用一些宏观的行为idendify出代码中的
void *custom_get_value(ObjectPtr)
返回值是不是被checked.If是怎么做我所有的地方去做?