Primitive argument count

Lex Spoon lex at lexspoon.org
Sat Sep 3 22:04:45 UTC 2005


Bert Freudenberg <bert at impara.de> wrote:
> I just noticed that many primitives do not check methodArgumentCount  
> but just pop a fixed assumed number of arguments. Wouldn't it be  
> better to always check this and fail if called with the wrong count?  
> I guess stack corruption isn't as big a problem for us as it is for  
> other systems, but still ... Another idea might be to "pop: self  
> methodArgumentCount + 1" in the end so it doesn't matter how many  
> arguments were supplied.
> 
> - Bert -

Keep in mind, though, that some people like to use Squeak in web
browsers.  For such people, it is vital that the VM not corrupt memory
no matter what code is running at the Squeak level.

-Lex



More information about the Vm-dev mailing list