summaryrefslogtreecommitdiff
path: root/t/op/loopctl.t
Commit message (Collapse)AuthorAgeFilesLines
* Use set_up_inc for several unit testsNicolas R2016-08-181-1/+1
| | | | | | | | | | | | | | | Use set_up_inc when require.pl is loaded move plan outside of BEGIN block when no tests are run at BEGIN time. Using set_up_inc allow to run these tests under minitest but also compile them using B::C. This also has the advantage to use a single control point for @INC setup. Note: some tests cannot use 'require test.pl', unshfit is then used for them.
* loopctl.c: Correct bug numFather Chrysostomos2015-03-181-1/+1
|
* Test preamble: unify to dot slash test dot plJarkko Hietaniemi2014-10-081-1/+1
|
* [perl #3112] Stop last from returning valuesFather Chrysostomos2013-09-201-2/+16
| | | | | | | | | | | | | | In push @a, last, it can try to return the @a, copying it like a sca- lar in the process, resulting in Bizarre copy of ARRAY in last. In do{{&{sub{"Just another Perl hacker,\n"}},last}}, it returns "Just another Perl hacker,\n". The former is clearly a bug. The latter depends on a side-effect of the same bug. ‘last’ really should not be trying to return the values that the same statement has accumulated so far.
* [perl #113684] Make redo/last/next/dump accept exprFather Chrysostomos2012-07-271-1/+38
| | | | | | | | | | | | | | | | | | | | | These functions have been allowing arbitrary expressions, but would treat anything that did not resolve to a const op as the empty string. Not only were arguments swallowed up without warning, but constant folding could change the behaviour. Computed labels are allowed for goto, and there is no reason to disallow them for these other ops. This can also come in handy for certain types of code generators. In the process of modifying pp functions to accept arbitrary labels, I noticed that the label and loop-popping code was identical in three functions, so I moved it out into a separate static function, to make the changes easier. I also had to reorder newLOOPEX significantly, because code under the goto branch needed to a apply to last, and vice versa. Using multiple gotos to switch between the branches created too much of a mess. I also eliminated the use of SP from pp_last, to avoid copying the value back and forth between SP and PL_stack_sp.
* constant folding shouldn't change return value of while [perl #73618]Jesse Luehrs2012-07-031-1/+62
| | | | | | | | | | If the expression in while (EXPR) is a false constant, just return that constant expression rather than OP_NULL during optimization. Doesn't handle until loops yet, because "until (1)" is converted to "while (!1)" by the parser, and so "!1" is already constant-folded to '' by the time the while loop optree is constructed. Not sure what to do about that.
* Fix for perl #112316: Wrong behavior regarding labels with same prefixBrian Fraser2012-04-061-1/+13
| | | | | | | | The code that compared non UTF-8 labels neglected to check that the label's length was equal before comparing them with a memEQ, which lead to code that used labels with the same prefixes to fail: ./perl -Ilib -E 'CATCH: { CATCHLOOP: { last CATCH; } die }'
* bad things happened with for $x (...) { *x = *y }David Mitchell2010-09-081-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | fix for [perl #21469]: since the GP may be pulled from under us and freed, coredumps and strange things can happen. Fix this by storing a pointer to the GV in the loop block, rather than a pointer to the GvSV slot. The ITHREADS variant already stores GV rather than than &GvSV; extend this to non-threaded builds too. Also, for both threaded and non-threaded, it used to push &GvSV on the save stack. Fix this by introducing a new save type, SAVEt_GVSV. This behaves similarly to SAVEt_SV, but without magic get/set. This means that for $package_var (...) is now close in behaviour to local $package_var = ... (except for the magic bit).
* t/op/loopctl.t using test.plDavid Landgren2006-04-281-119/+92
| | | | | Message-ID: <4450FBB8.8070203@landgren.net> p4raw-id: //depot/perl@27991
* [perl #37725] perl segfaults on reversed array referenceDave Mitchell2005-11-221-1/+14
| | | | | | The 'for (reverse @a)' optimisation got its index wrong when create LVALUE SVs for undef elements p4raw-id: //depot/perl@26195
* while (my $x ...) { ...; redo } shouldn't undef $x.Dave Mitchell2005-05-071-1/+26
| | | | | | | In the presence of 'my' in the conditional of a while(), until(), or for(;;) loop, add an extra scope to the body so that redo doesn't undef the lexical p4raw-id: //depot/perl@24412
* [perl #27206] Memory leak in continue loopDave Mitchell2004-03-041-1/+24
| | | | | make sure redo always frees temps p4raw-id: //depot/perl@22438
* Exit via last, part 1Michael G. Schwern2001-04-151-1/+22
| | | | | Message-ID: <20010414221359.A413@blackrider.blackstar.co.uk> p4raw-id: //depot/perl@9711
* Re: [ID 20010309.004] my-variables lose values while goto'ing within a ↵Robin Houston2001-03-141-0/+925
for(;;)-loop Message-ID: <20010314004345.A15892@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9139