Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[PATCH] Force OP_REQUIRE to scalar context at the end of ck_require

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


gerard at ggoossen

Nov 16, 2009, 5:09 AM

Post #1 of 5 (338 views)
Permalink
[PATCH] Force OP_REQUIRE to scalar context at the end of ck_require

Force OP_REQUIRE to scalar context at the end of ck_require and don't let
it become void context.
Fixes problem with require not always being in scalar context.

Gerard Goossen


gerard at ggoossen

Nov 16, 2009, 6:41 AM

Post #2 of 5 (310 views)
Permalink
Re: [PATCH] Force OP_REQUIRE to scalar context at the end of ck_require [In reply to]

Now includes patch.

On Mon, Nov 16, 2009 at 02:09:13PM +0100, Gerard Goossen wrote:
> Force OP_REQUIRE to scalar context at the end of ck_require and don't let
> it become void context.
> Fixes problem with require not always being in scalar context.
>
> Gerard Goossen
>
>
Attachments: 0002-Force-OP_REQUIRE-to-scalar-context-at-the-end-of-ck_.patch (2.71 KB)


rgs at consttype

Nov 16, 2009, 8:13 AM

Post #3 of 5 (320 views)
Permalink
Re: [PATCH] Force OP_REQUIRE to scalar context at the end of ck_require [In reply to]

That's on top of the add-a-TODO-test patch you sent previously, right ?

That's odd, because I thought I had fixed that one years ago,
precisely with the code you removed:

http://perl5.git.perl.org/perl.git/commitdiff/0c58d367e297133798f6e191e83d3087e2617588

at a first glance, your code looks more correct than mine; I'll look
at it more closely when time permits.

2009/11/16 Gerard Goossen <gerard [at] ggoossen>:
> Now includes patch.
>
> On Mon, Nov 16, 2009 at 02:09:13PM +0100, Gerard Goossen wrote:
>> Force OP_REQUIRE to scalar context at the end of ck_require and don't let
>> it become void context.
>> Fixes problem with require not always being in scalar context.
>>
>> Gerard Goossen
>>
>>
>



--
"You don't mean odds and ends, you mean des curieux et des bouts",
corrected the manager.
-- Terry Pratchett, Hogfather


gerard at ggoossen

Nov 16, 2009, 8:34 AM

Post #4 of 5 (316 views)
Permalink
Re: [PATCH] Force OP_REQUIRE to scalar context at the end of ck_require [In reply to]

On Mon, Nov 16, 2009 at 05:13:10PM +0100, Rafael Garcia-Suarez wrote:
> That's on top of the add-a-TODO-test patch you sent previously, right ?

Yes.

> That's odd, because I thought I had fixed that one years ago,
> precisely with the code you removed:
>
> http://perl5.git.perl.org/perl.git/commitdiff/0c58d367e297133798f6e191e83d3087e2617588
>
> at a first glance, your code looks more correct than mine; I'll look
> at it more closely when time permits.

That patch only fixed a special case, where the require is at the end of
an eval, not the other cases where the op doesn't get forced to a context,
as for example using a "return" as in the TODO test. I made a more general
fix and removed your fix of the special case.

Gerard Goossen


rgs at consttype

Nov 21, 2009, 10:43 AM

Post #5 of 5 (291 views)
Permalink
Re: [PATCH] Force OP_REQUIRE to scalar context at the end of ck_require [In reply to]

Thanks, applied alongside the corresponding regression test patch.

2009/11/16 Gerard Goossen <gerard [at] ggoossen>:
> Now includes patch.
>
> On Mon, Nov 16, 2009 at 02:09:13PM +0100, Gerard Goossen wrote:
>> Force OP_REQUIRE to scalar context at the end of ck_require and don't let
>> it become void context.
>> Fixes problem with require not always being in scalar context.
>>

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.