- 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
|
||||
)
|
||||
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")
|
||||
list(INSERT ${list_id} "${_index}" ${item_add})
|
||||
unset(_index)
|
||||
@@ -37,7 +40,10 @@ macro(list_insert_before
|
||||
list_id item_check item_add
|
||||
)
|
||||
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})
|
||||
unset(_index)
|
||||
endmacro()
|
||||
|
Reference in New Issue
Block a user