Issue 5642 in pharo: better tempNamed:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5642 in pharo: better tempNamed:

pharo
Status: FixToInclude
Owner: [hidden email]
Labels: Milestone-2.0

New issue 5642 by [hidden email]: better tempNamed:
http://code.google.com/p/pharo/issues/detail?id=5642

[ |a| a := 2. a] asContext tempNamed: 'a' returns nil now and not subscript

tempNamed: aName
        "Returns the value of the temporaries, aName."
        "Implementation notes: temporary initialization in blocks simply uses  
pushNil to allocate and initialize each temp.  So if one inspects [|a|a:=2]  
and sends it self method symbolic you get:

        13 <8F 00 00 05> closureNumCopied: 0 numArgs: 0 bytes 17 to 21
        17 <73> pushConstant: nil
        18 <77> pushConstant: 2
        19 <81 40> storeIntoTemp: 0
        21 <7D> blockReturn
        22 <7C> returnTop

        And when we check self asContext pc we get 17, which is *before* the nil  
is pushed. Therefore we should pay attention when querying a temporary if  
the temporary allocation was executed."

        | index |
        index := (self tempNames indexOf: aName).
        ^ index >= stackp
                ifTrue: [ nil]
                ifFalse: [self tempAt: (self tempNames indexOf: aName)]

Attachments:
        ContextPart-tempAtput.st  282 bytes


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5642 in pharo: better tempNamed:

pharo

Comment #1 on issue 5642 by [hidden email]: better tempNamed:
http://code.google.com/p/pharo/issues/detail?id=5642

(No comment was entered for this change.)

Attachments:
        MethodContext-tempNamed.st  959 bytes


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5642 in pharo: better tempNamed:

pharo
In reply to this post by pharo
Updates:
        Status: Integrated

Comment #3 on issue 5642 by [hidden email]: better tempNamed:
http://code.google.com/p/pharo/issues/detail?id=5642

in 2.0 020


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