- cmake macro list_insert_after/list_insert_before now error when the item passed is not found in the list.
- BKE_pose_copy_data() check for target pointer is no longer valid and infact comparing against un-initialized memory in some cases.
This commit is contained in:
@@ -27,7 +27,10 @@ macro(list_insert_after
|
|||||||
list_id item_check item_add
|
list_id item_check item_add
|
||||||
)
|
)
|
||||||
set(_index)
|
set(_index)
|
||||||
list(FIND ${list_id} "${item_check}" _index)
|
list(FIND "${list_id}" "${item_check}" _index)
|
||||||
|
if("${_index}" MATCHES "-1")
|
||||||
|
message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
|
||||||
|
endif()
|
||||||
math(EXPR _index "${_index} + 1")
|
math(EXPR _index "${_index} + 1")
|
||||||
list(INSERT ${list_id} "${_index}" ${item_add})
|
list(INSERT ${list_id} "${_index}" ${item_add})
|
||||||
unset(_index)
|
unset(_index)
|
||||||
@@ -37,7 +40,10 @@ macro(list_insert_before
|
|||||||
list_id item_check item_add
|
list_id item_check item_add
|
||||||
)
|
)
|
||||||
set(_index)
|
set(_index)
|
||||||
list(FIND ${list_id} "${item_check}" _index)
|
list(FIND "${list_id}" "${item_check}" _index)
|
||||||
|
if("${_index}" MATCHES "-1")
|
||||||
|
message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
|
||||||
|
endif()
|
||||||
list(INSERT ${list_id} "${_index}" ${item_add})
|
list(INSERT ${list_id} "${_index}" ${item_add})
|
||||||
unset(_index)
|
unset(_index)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@@ -532,12 +532,6 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*dst == src) {
|
|
||||||
printf("BKE_pose_copy_data source and target are the same\n");
|
|
||||||
*dst = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
outPose = MEM_callocN(sizeof(bPose), "pose");
|
outPose = MEM_callocN(sizeof(bPose), "pose");
|
||||||
|
|
||||||
BLI_duplicatelist(&outPose->chanbase, &src->chanbase);
|
BLI_duplicatelist(&outPose->chanbase, &src->chanbase);
|
||||||
|
Reference in New Issue
Block a user