- Fixed a really subtle bug in some of the uses of _IDC_SetAttr(). In a couple of locations the call is made as part of the condition of an IF. But _IDC_SetAttr() will always return None ( "return setattr(obj, attrmap[attroffs][1], value)" ), leading to the value being properly set in the instance but never updated in the IDB. Which led to mysterious behavior because of "vanishing" attributes

This commit is contained in:
ero.carrera@gmail.com 2010-04-12 17:12:23 +00:00
parent 4bd83af5a3
commit 53d99a141a

View File

@ -3892,7 +3892,8 @@ def SetFunctionAttr(ea, attr, value):
""" """
func = idaapi.get_func(ea) func = idaapi.get_func(ea)
if func and _IDC_SetAttr(func, _FUNCATTRMAP, attr, value): if func:
_IDC_SetAttr(func, _FUNCATTRMAP, attr, value)
return idaapi.update_func(func) return idaapi.update_func(func)
@ -5231,7 +5232,8 @@ def SetFchunkAttr(ea, attr, value):
""" """
if attr in [ FUNCATTR_START, FUNCATTR_END, FUNCATTR_OWNER ]: if attr in [ FUNCATTR_START, FUNCATTR_END, FUNCATTR_OWNER ]:
chunk = idaapi.get_fchunk(ea) chunk = idaapi.get_fchunk(ea)
if chunk and _IDC_SetAttr(chunk, _FUNCATTRMAP, attr, value): if chunk:
_IDC_SetAttr(chunk, _FUNCATTRMAP, attr, value)
return idaapi.update_func(chunk) return idaapi.update_func(chunk)