2009/10/7 Johan Brichau <[email protected]>:
> This fixes it.
> It seems the last 2 literals in each method are selector and
> classbinding.
>
> So now I will try to submit it as a pharo-process-compatible patch too
> (I should learn someday anyway... :-)
>
> ----
> CompiledMethod>>refersToLiteral: aLiteral
>        "Answer true if any literal in this method is literal, even if
> embedded in array structure or within its pragmas."
>        "only iterate to numLiterals - 1 , as the last has the classBinding
> and method selector"
>        2
>                to: self numLiterals - 1
>                do:
>                        [ :index |
>                        | literal |
>                        literal := self objectAt: index.
>                        literal == aLiteral ifTrue: [ ^ true ].
>                        (literal refersToLiteral: aLiteral) ifTrue: [ ^ true ] 
> ].
>        ^ false
>

Maybe its worth to change #literalsDo: method to not iterate over
class and method selector?
And then use it in #refersToLiteral: ?

-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to