fix #K3888 - object lost panic cased by lava
Report was for spell-casting monster using the destroy armor spell on hero's levitation boots while hero was floating over lava. The boots became unworn but still in inventory, hero dropped into lava, the boots happened to be an inventory item which got burned up, then the call stack unwound back to the destroy armor routine which tried to finish by deleting them but they were already gone by then. Could also happen for black dragon breath, hero reading scroll of destroy armor, or overenchanting the boots with scroll of enchant armor, so not so unlikely that nobody would be expected to notice. Initially I couldn't reproduce the object lost panic. It only happens if the memory used by the boots is cleared or clobbered during first time it's freed, otherwise second free doesn't notice any problem. The 'wornarm_destroyed()' portion of this commit is sufficient to fix this. The other bits are things I tried before figuring out how to reproduce it, plus zeroing out any object passed to dealloc_obj().
This commit is contained in:
@@ -1121,7 +1121,11 @@ feedback if a named, shape-shifted vampire reverted to original shape rather
|
||||
adjust archeologist and valkyrie starting intrinsics
|
||||
once per game if receiving killing blow from near-full hp, leave 1 hp
|
||||
spell of knock can knock back small monsters
|
||||
protection from shape changers prevents the Wizard from mimicking monsters
|
||||
protection from shape changers now prevents the Wizard from mimicking monsters
|
||||
having worn levitation boots removed and destroyed (scroll, monster spell,
|
||||
dragon breath) and floating down into lava can destroy them twice;
|
||||
yielded "object lost" panic if program had been built with a debugging
|
||||
malloc implementation which overwrites the contents of freed memory
|
||||
|
||||
|
||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||
|
||||
Reference in New Issue
Block a user