



A dynamically-created object is deleted by sending a message
of the form MyClass.destroy(MyObj), where MyObj was previously created
by the statement MyObj=MyClass.create().
If the 'destroy' message is by mistake sent to some other class,
the Z-machine interpreter may misbehave, while the Glulx interpreter may crash when attempting to read
memory beyond the end of the game.
The following code demonstrates the problem: Changing MySuperClass.destroy(MyObj)
to MyClass.destroy(MyObj) fixes the problem. None submitted.
The problem needs to be detected at run-time,
and it is not clear whether the current data structures contain enough information
to make this possible.
About Patches
Issue C63111 [previous patch]
MyClass.destroy(MyObj) may crash interpreter
Submitted by: Mike Tarage
Appeared in: Compiler 6.31 or before
Fixed in: -
Problem
Class MySuperClass;
Class MyClass(10)
class MySuperClass;
Object HostObj;
MyObj = MyClass.create();
move MyObj to HostObj;
MySuperClass.destroy(MyObj); ! Problem occurs here
Solution
Last updated 2 May 2008. The librarian in charge of this page is Roger Firth. Please email any comments, suggestions or corrections to roger@firthworks.com.