The Trunk: Compiler-cwp.97.mcz

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

The Trunk: Compiler-cwp.97.mcz

commits-2
Colin Putney uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-cwp.97.mcz

==================== Summary ====================

Name: Compiler-cwp.97
Author: cwp
Time: 16 November 2009, 8:35:05 am
UUID: 815de973-26b4-4f93-b1ee-4905e56fa4b3
Ancestors: Compiler-nice.96

Added a test that demonstrates a bug in block copying.

If a block containing a return is copied, it will raise BlockCannotReturn when it's evaluated, even if the home context is still on the stack.

http://bugs.squeak.org/view.php?id=7414

=============== Diff against Compiler-nice.96 ===============

Item was added:
+ ----- Method: ClosureTests>>evaluateCopyOf: (in category 'utilities') -----
+ evaluateCopyOf: aBlock
+ aBlock copy value!

Item was added:
+ ----- Method: ClosureTests>>testCopyNonLocalReturn (in category 'testing') -----
+ testCopyNonLocalReturn
+ self
+ shouldnt: [self methodWithNonLocalReturn]
+ raise: Error!

Item was added:
+ ----- Method: ClosureTests>>methodWithNonLocalReturn (in category 'utilities') -----
+ methodWithNonLocalReturn
+ self evaluateCopyOf: [^ self].
+ self signalFailure: 'Should never reach here'!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-cwp.97.mcz

Nicolas Cellier
Easy, see Kernel-nice.300 (Eliot already suggested the solution a few
week sooner)

2009/11/16  <[hidden email]>:

> Colin Putney uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-cwp.97.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-cwp.97
> Author: cwp
> Time: 16 November 2009, 8:35:05 am
> UUID: 815de973-26b4-4f93-b1ee-4905e56fa4b3
> Ancestors: Compiler-nice.96
>
> Added a test that demonstrates a bug in block copying.
>
> If a block containing a return is copied, it will raise BlockCannotReturn when it's evaluated, even if the home context is still on the stack.
>
> http://bugs.squeak.org/view.php?id=7414
>
> =============== Diff against Compiler-nice.96 ===============
>
> Item was added:
> + ----- Method: ClosureTests>>evaluateCopyOf: (in category 'utilities') -----
> + evaluateCopyOf: aBlock
> +       aBlock copy value!
>
> Item was added:
> + ----- Method: ClosureTests>>testCopyNonLocalReturn (in category 'testing') -----
> + testCopyNonLocalReturn
> +       self
> +               shouldnt: [self methodWithNonLocalReturn]
> +               raise: Error!
>
> Item was added:
> + ----- Method: ClosureTests>>methodWithNonLocalReturn (in category 'utilities') -----
> + methodWithNonLocalReturn
> +       self evaluateCopyOf: [^ self].
> +       self signalFailure: 'Should never reach here'!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-cwp.97.mcz

Colin Putney

On 16-Nov-09, at 9:03 AM, Nicolas Cellier wrote:

> Easy, see Kernel-nice.300 (Eliot already suggested the solution a few
> week sooner)

Thanks for getting that for me. I remembered the discussion, but  
didn't have time to dig up the fix.

Colin

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-cwp.97.mcz

Nicolas Cellier
2009/11/16 Colin Putney <[hidden email]>:

>
> On 16-Nov-09, at 9:03 AM, Nicolas Cellier wrote:
>
>> Easy, see Kernel-nice.300 (Eliot already suggested the solution a few
>> week sooner)
>
> Thanks for getting that for me. I remembered the discussion, but didn't have
> time to dig up the fix.
>
> Colin
>
>

Hehe,
my capacity to memorize useless information sometimes prevent me to be
intelligent (like understand all the closure tricks), but that
sometimes help :)

Nicolas