Posted by
Igor Stasenko on
Mar 21, 2011; 1:22pm
URL: https://forum.world.st/test-crashing-the-cog-vm-tp3393032p3393558.html
On 21 March 2011 13:14, Toon Verwaest <
[hidden email]> wrote:
> I couldn't agree more!
>
> However, here the problem is not that the format isn't a correct format. The
> problem is that a bytecode is activated that is incompatible with the
> instance format. So basically on every bytecode accessing an instance you
> would have to check if this is a valid access. And as we all know, Smalltalk
> avoids this; it makes things faster :)
>
In other words, a responsibility of having correct bytecode lies on
image side, not on VM side.
Adding a bytecode verifier to VM will be a lot of work.. And of course
it could verify it only when you installing a method,
not when you activating it.
> Toon
>
> On 03/21/2011 12:49 PM, Igor Stasenko wrote:
>>
>> On 21 March 2011 11:29, Tudor Girba<
[hidden email]> wrote:
>>>
>>> Thanks, Toon!
>>>
>>> I changed the code to explicitly set the format, and it seems to fix the
>>> problem:
>>>
>>> cls := Class new superclass: MooseElement;
>>> setFormat: MooseElement format;
>>> yourself.
>>> cls compileSilently: 'mooseName ^ 1/0'.
>>> element := cls new.
>>>
>>> Is this correct?
>>>
>> Yes, you should pay attention to have correct format.
>> But of course VM could also be more cautios and verify if your class
>> are well formed before creating an instance of it..
>>
>>
>>
>>> Cheers,
>>> Doru
>>>
>>
>>
>
>
>
--
Best regards,
Igor Stasenko AKA sig.