[Cuis-dev] Error performing advised methods

Mariano Montone marianomontone at gmail.com
Fri Jan 13 06:51:38 PST 2023


El 13/1/23 a las 11:11, Mariano Montone escribió:
> Hi,
>
> There's an error with AdvisedMethod's implementation I would like to fix.
>
> When installing an AdvisedMethod, an error is signaled if the method 
> tries to be performed (calling #perform:), instead of called directly.
>
> I mean: myObject myAdvisedMethod, works. But: myObject perform: 
> #myAdvisedMethod, doesn't.
>
> The error says: 'bad number of arguments' when calling the primitive 
> in #perform: (primitive nr. 83).
>
> AdvisedMethods are implemented like this:
>
> AdvisedMethod is a subclass of Object that implements #run: aSelector 
> with: arguments in: aReceiver .
>
> To advise a method, the CompiledMethod instance at method selector in 
> the class method dictionary is replaced by an instance of AdvisedMethod.
>
> Any ideas of what you think the problem is, possible fixes or things I 
> could try are welcomed.
>
> Thanks!
>
>
>         Mariano
>
I've tested in old images now, and this works there.


This used to work when the #perform: implemented like this:


perform: arg1
     <primitive: 83>
     ^ self
         perform: arg1
         withArguments: (Array new: 0).



More information about the Cuis-dev mailing list