[Vm-dev] regression: TestObjectsAsMethods crash in 4.19.5 (not in 4.16.7)

David T. Lewis lewis at mail.msen.com
Sat Mar 20 16:01:22 UTC 2021


On Fri, Mar 19, 2021 at 01:14:32PM -0700, Vanessa Freudenberg wrote:
>  
> 
> Ah that makes sense. Yes, in SqueakJS it is used directly too:
> 
> https://github.com/codefrau/SqueakJS/blob/02d88e6cd5592029071c1939d85181b79a8f0d7a/vm.interpreter.js#L934
> 
> 
> ... and the easiest fix would indeed be to assign an unused primitive
> number, because that would require no changes to the rest of the
> execution mechanism. Putting it in the lookup phase, and caching it, seems
> quite elegant. Otherwise we would have to find another place to check that
> the method dict entry is actually a method, and invoke the run:with:in:
> mechanism if not.
> 

Hmmm that gives me an idea. We can extend the actual size of the primitive
table beyond MaxPrimitiveIndex and hide primitiveInvokeObjectAsMethod there.
That protects it against accidental invocation from the image as more numbered
primitives get added (yuk). I'll give that a try and see how it looks.

Dave



More information about the Vm-dev mailing list