summaryrefslogtreecommitdiff
path: root/scope.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-081-4/+0
| | | | The build has been broken since 2009.
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-0/+1
| | | | | | | | | | | | | | | Adds syntax `defer { BLOCK }` to create a deferred block; code that is deferred until the scope exits. This syntax is guarded by use feature 'defer'; Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field gives the start of an optree to be deferred until scope exit. That op pointer will be stored on the save stack and invoked as part of scope unwind. Included is support for `B::Deparse` to deparse the optree back into syntax.
* Rename G_ARRAY to G_LIST; provide back-compat when not(PERL_CORE)Paul "LeoNerd" Evans2021-06-021-1/+1
|
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-404/+404
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* Implement SAVEt_STRLEN_SMALLPaul "LeoNerd" Evans2020-12-091-3/+17
| | | | | | | Most uses of SAVEt_STRLEN actually store small values; often zero. Rather than using an entire U64-sized element for these values, it saves space to use the same "SMALL" mechanism as other numerical values, like SAVEt_INT_SMALL.
* autodoc.pl: Enhance apidoc_section featureKarl Williamson2020-11-061-1/+1
| | | | | | | | | | | This feature allows documentation destined for perlapi or perlintern to be split into sections of related functions, no matter where the documentation source is. Prior to this commit the line had to contain the exact text of the title of the section. Now it can be a $variable name that autodoc.pl expands to the title. It still has to be an exact match for the variable in autodoc, but now, the expanded text can be changed in autodoc alone, without other files needing to be updated at the same time.
* Reorganize perlapiKarl Williamson2020-09-041-1/+1
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Define a new SAVEt_HINT_HH typePaul "LeoNerd" Evans2020-07-301-11/+16
| | | | | | | | | | | Rather than possibly push an extra HV* to the save stack if the right bit is set in the (saved) hints flags, better just to define a different SAVEt type. Having done this, the stack layout is now constant per type value. This fixes https://github.com/Perl/perl5/issues/17895
* Ensure stack is in consistent state while restoring SAVEt_HINTSPaul "LeoNerd" Evans2020-07-201-1/+7
| | | | | | | | | | | | | | | SAVEt_HINTS has a non-constant savestack structure. If the HINT_LOCALIZE_HH flag was set it pushes an additional pointer. In some complex code scenarios it is possible reënter Perl code while destroying nested PL_hintgv hashes (for example, if any stored objects contain `free` magic). Because of this, it is important that we pop the extra value from the save stack before any other code can be invoked, so if they need to inspect or alter the save stack, they can do so in a consistent manner. See also https://github.com/Perl/perl5/issues/17895
* fixup to free_and_set_cop_warnings()David Mitchell2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | | v5.31.9-156-g94c8b9c1f0 introduced the free_and_set_cop_warnings() macro. It's first argument expects a COP rather than a COP*. Its usage in S_restore_cop_warnings(() is to modify PL_cucop, but in order to pass a COP rather than a COP*, the original commit made a local copy of PL_curcop and ended up inadvertently updating the copy instead. This commit changes the maco so it expects a COP*, and updates the bulk of its callers to use &PL_compiling rather than PL_compiling, and fixes up S_restore_cop_warnings(). The symptoms were ASAN failures in a few test scripts including uni/parser.t and ext/XS-APItest/t/handy0*.t. (The S_restore_cop_warnings() function was only used by Perl__force_out_malformed_utf8_message(), so didn't cause many issues outside of test scripts which forced such "malformed "errors).
* Add macro to free and set cop_warningsNicolas R2020-03-161-3/+1
| | | | | This is avoiding the boilerplate to free the cop_warning string when setting it.
* treat TAINT_get and TAINTING_get as unlikelyTony Cook2019-12-161-1/+1
| | | | | | | | | | | | | | | | | While testing #17359 it appeared that inlining of SvTRUE was being suppressed (indicated by -Winline) by being used in the statement: if (TAINT_get || SvTRUE(error)) { but making TAINT_get unlikely allowed it to be inlined. I expect even in a program that does use taint the vast majority of data will be untainted, so I think it's safe to make TAINT_get UNLIKELY(). TAINTING_get is a harder case, but it's only used in a relatively much smaller number of cases, and I expect most runs of a system perl will have neither -T nor -t.
* Faster feature checksTony Cook2019-10-301-0/+2
| | | | | | | | | | | | | | | Perform only a bit check instead of a much more expensive hash lookup to test features. For now I've just added a U32 to the cop structure to store the bits, if we need more we could either add more bits directly, or make it a pointer. We don't have the immediate need for a pointer that warning do since we don't dynamically add new features during compilation/runtime. The changes to %^H are retained so that caller() can be used from perl code to check the features enabled at a given caller's scope.
* Un-revert "[MERGE] add+use si_cxsubix field"David Mitchell2019-09-231-0/+1
| | | | | | | | original merge commit: v5.31.3-198-gd2cd363728 reverted by: v5.31.4-0-g20ef288c53 The commit following this commit fixes the breakage, which that means the revert can be undone.
* Revert "[MERGE] add+use PL_curstackinfo->si_cxsubix field"v5.31.4Max Maischein2019-09-201-1/+0
| | | | | | | | | | | | This reverts commit d2cd363728088adada85312725ac9d96c29659be, reversing changes made to 068b48acd4bdf9e7c69b87f4ba838bdff035053c. This change breaks installing Test::Deep: ... not ok 37 - Test 'isa eq' completed ok 38 - Test 'isa eq' no premature diagnostication ...
* add PL_curstackinfo->si_cxsubix fieldDavid Mitchell2019-09-191-0/+1
| | | | | | | | | | | | | This tracks the most recent sub/eval/format context pushed onto the context stack. Then make dopopto_cursub use it. The previous value is saved in the cxt struct, and is restored whenever the context is popped. This adds a tiny overhead for every sub call, but speeds up other operations, such as determining the caller context when returning a value from a sub - this has to be dpne for every sub call where the last expression is context sensitive, so its often a win.
* perlapi: save_gp is a GV functionKarl Williamson2019-08-091-0/+3
|
* avoid leak with local $h{foo}, $a[n]David Mitchell2019-03-261-3/+14
| | | | | | | | | | | | | | When SAVEt_DELETE / SAVEt_ADELETE deletes a hash/array entry on scope exit, they also decrement the refcount of the hash/array, and for the hash, also free the saved key. However, if the call to hv_delete() or av_delete() dies (e.g. when calling a tied DELETE method) then the hash/array and key will leak because leave_scope() calls av/hv_delete(), *then* does the SvREFCNT_dec() etc. The fix is to push new FREEPV/FREESV actions just before calling av/hv_delete().
* revert smartmatch to 5.27.6 behaviourZefram2017-12-291-1/+0
| | | | | | | | | | | | | The pumpking has determined that the CPAN breakage caused by changing smartmatch [perl #132594] is too great for the smartmatch changes to stay in for 5.28. This reverts most of the merge in commit da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and documentation is reverted. The removal of use of smartmatch from a couple of tests (that aren't testing smartmatch) remains. Customisation of a couple of CPAN modules to make them portable across smartmatch types remains. A small bugfix in scope.c also remains.
* make loop control apply to "given"Zefram2017-11-291-1/+3
| | | | A "given" construct is now officially a one-iteration loop.
* Use memEQs, memNEs in core filesKarl Williamson2017-11-061-4/+2
| | | | | | | | | | Where the length is known, we can use these functions which relieve the programmer and the program reader from having to count characters. The memFOO functions should also be slightly faster than the strFOO equivalents. In some instances in this commit, hard coded numbers are used. These come from the 'case' statement values that apply to them.
* [perl #129916] Allow sub-in-stash outside of mainFather Chrysostomos2017-10-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sub-in-stash optimization introduced in 2eaf799e only applied to subs in the main stash, not in other stashes, due to a problem with the logic in newATTRSUB. This comment: Also, we may be called from load_module at run time, so PL_curstash (which sets CvSTASH) may not point to the stash the sub is stored in. explains why we need the PL_curstash != CopSTASH(PL_curcop) check. (Perl_load_module will fail without it.) But that logic does not work properly at compile time (when PL_curcop == &PL_compiling). The value of CopSTASH(&PL_compiling) is never actually used. It is always set to the main stash. So if we check that PL_curstash != CopSTASH(PL_curcop) and forego the optimization in that case, we will never optimize subs outside of the main stash. What we really need is to check IN_PERL_RUNTIME && PL_curstash != opSTASH(PL_curcop). I.e., forego the optimization at run time if the stashes differ. That is what this commit implements. One observable side effect of this change is that deleting a stash element no longer anonymizes the CV if the CV had no GV that it was depending on to provide its name. Since the main thing in such situa- tions is that we do not get a crash, I think this change (arguably an improvement) is acceptable.) ----------- A bit of explanation of various other changes: gv.c:require_tie_mod needed a bit of help, since it could not handle sub refs in stashes. To keep localisation of stash elements working the same way, local($Stash::{foo}) now upgrades a coderef to a full GV before the localisation. (Changes in two pp*.c files and in scope.c:save_gp.) t/op/stash.t contains a test that makes sure that perl does not crash when a GV with a CV pointing to it gets deleted. This commit tweaks the test so that it continues to test that. (There has to be a GV for the test to test what it is meant to test.) Similarly with t/uni/caller.t and t/uni/stash.t. op.c:rv2cv_op_cv with the _MAYBE_NAME_GV flag was returning the cal- ling GV in those cases where a GV-less sub is called via a GV. E.g., *main = \&Foo::foo; main(). This meant that errors like ‘Not enough arguments’ were giving the wrong sub name. newATTRSUB was not calling mro_method_changed_in when storing a sub as an RV. gv_init needs to arrange for the new GV to have the file and line num- ber corresponding to the sub in it. These are taken from CvSTART, which may be off by a few lines, but is the closest we have to the place the sub was declared.
* Add CvGvNAME_HEK helperNicolas R2017-09-211-7/+2
| | | | | | | CvGvNAME_HEK can be used instead of the boilerplate: CvNAMED(sv) ? CvNAME_HEK((CV *)sv) : GvNAME_HEK(CvGV(sv)) This is also saving an extra CvNAMED check from CvNAME_HEK.
* add PL_curstackinfo->si_stack_hwmDavid Mitchell2017-06-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | On debugging builds only, add a mechanism for checking pp function calls for insufficient stack extending. It works by: * make the runops loop set a high-water-mark (HWM) variable equal to PL_stack_sp just before calling each pp function; * make EXTEND() etc update this HWM; * on return from the pp function, panic if PL_stack_sp is > HWM. This detects whether pp functions are pushing more items onto the stack than they are requesting space for. There's a possibility of false positives if the code is doing weird stuff like direct manipulation of stacks via PL_curstack, SWITCHSTACK() etc. It's also possible that one pp function "knows" that a previous pp function will have already grown the stack enough. Currently the only place in core that seems to do this is pp_enteriter, which allocates 1 stack slot so that pp_iter doesn't have to check each time it returns &PL_sv_yes/no. To accommodate this, the new macro EXTEND_SKIP() has been added, that tells perl that it's safely skipping an EXTEND() here.
* PERL_GLOBAL_STRUCT_PRIVATE: fix scope.c:arg_countsDavid Mitchell2017-03-171-1/+1
| | | | | t/porting/libperl.t under -DPERL_GLOBAL_STRUCT_PRIVATE doesn't like non-const static data structures
* update size after RenewHugo van der Sanden2017-03-151-12/+17
| | | | | | | | | | | | | | | RT #130841 In general code, change this idiom: PL_foo_max += size; Renew(PL_foo, PL_foo_max, foo_t); to Renew(PL_foo, PL_foo_max + size, foo_t); PL_foo_max += size; so that if Renew dies, PL_foo_max won't be left hanging.
* Change white space to avoid C++ deprecation warningKarl Williamson2016-11-181-25/+25
| | | | | | | | | | | | | | | | | | | | | | C++11 requires space between the end of a string literal and a macro, so that a feature can unambiguously be added to the language. Starting in g++ 6.2, the compiler emits a warning when there isn't a space (presumably so that future versions can support C++11). Unfortunately there are many such instances in the perl core. This commit fixes those, including those in ext/, but individual commits will be used for the other modules, those in dist/ and cpan/. This commit also inserts space at the end of a macro before a string literal, even though that is not deprecated, and removes useless "" literals following a macro (instead of inserting a blank). The result is easier to read, making the macro stand out, and be clearer as to the intention. Code and modules included with the Perl core need to be compilable using C++. This is so that perl can be embedded in C++ programs. (Actually, only the hdr files need to be so compilable, but it would be hard to test that just the hdrs are compilable.) So we need to accommodate changes to the C++ language.
* add any_op field to the ANY savestack unionDavid Mitchell2016-08-171-1/+1
| | | | This is an attempt to silence a (probably spurious) Coverity warning.
* scope.c: Appease C++Father Chrysostomos2016-08-121-2/+4
| | | | C++ is dumb.
* leave_scope(): combine the SAVEt_*PTR branchesDavid Mitchell2016-08-121-13/+1
| | | | They're all the same, except for casts between different pointer types.
* leave_scope(): eliminate a couple of local varsDavid Mitchell2016-08-121-23/+29
| | | | | | | | | | | | Remove svp and i from the main loop and only declare them in the inner scopes that require them. Where values get passing around in goto restore_sv/restore_svp, pass the value in an unused a0/a2 var instead. Also eliminate the one use of the 'type' var within the loop - that way the compiler doesn't have to hang on the value when executing the switch. Makes the object code a bit smaller.
* clean up leave_scope()David Mitchell2016-08-121-186/+207
| | | | | | | | | | | | | | | | | | | | Rather than having a whole bunch of casting macros like #define ARG0_SV MUTABLE_SV(arg0.any_ptr) just add extra pointer types to the ANY union and directly do arg0.any_sv etc. Also, rename arg0, arg1, arg2 to a0, a1, a2 and reverse their order; previously if 3 args A,B,C were pushed onto the savestack, they were popped as a0=C, a1=B, a2=A; now do it as a0=A, a1=B, a2=C. The previous (rather odd) order was an artifact of the old way leave_scope() used to pop its args. There should be no functional changes.
* leave_scope(): pop args in each branchDavid Mitchell2016-08-111-30/+127
| | | | | | | | | | | | | About 4 years ago I heavily refactored Perl_leave_scope(). One of the things I did was to pop the args for each action once at the top of the loop. This involved a number of nested condtionals. This commit makes each action (i.e. each switch branch) responsible for copying its own args off the save stack, while the top of loop is still responsible for decrementing PL_savestack_ix. The gain is marginal, but it makes the code cleaner and the object code smaller.
* Unmathomize save_ivFather Chrysostomos2016-07-271-0/+11
| | | | I need to call it from toke.c.
* Fix STRESS_REALLOC after 3caf0269dFather Chrysostomos2016-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: commit 3caf0269dd4c609b8c2bc22b54598c642ba63ed8 Author: David Mitchell <davem@iabyn.com> Date: Sun Dec 27 14:07:02 2015 +0000 offset PL_savestack_max by SS_MAXPUSH stopped savestack_grow from adding 4 to the allocated amount, which broke builds with -Accflags=-DSTRESS_REALLOC. savestack_grow accepts no arguments. The callers have no way to tell it how much to allocate; they just assume that it will allocate enough. By default, in increases the stack size by 50%, and the stack starts out at 128 elements, so everything works fine. Under STRESS_REALLOC, introduced by commit 2ce36478e5 in ’98, the savestack started out at 1 (later, SS_MAXPUSH; as of 3caf0269d, PL_savestack_max is 0 initially, though the actual stack size is SS_MAXPUSH). And the stack-growing functions in scope.h that default to 50% instead add 1 element to the stack. Anything that calls savestack_grow assumes it will allocate enough for the savestack elements pushed. The most elements ever pushed at once is 4, so 2ce36478e5 added a +4 to the size in savestack_grow. 3caf0269d removed that +4, so the stack is only incremented by 1, and this assertion at the end of scope.h:SS_ADD_END failed: if (UNLIKELY(ix > PL_savestack_max)) savestack_grow(); \ assert(PL_savestack_ix <= PL_savestack_max); 3caf0269d was right in removing the +4, since it is unnecessary for normal builds. For STRESS_REALLOC, which is designed to grow stacks as little as possible, we were allocating one more element than neces- sary. So this commit just explicitly grows the stack by SS_MAXPUSH (the new name for 4) in savestack_grow if STRESS_REALLOC is defined.
* offset PL_savestack_max by SS_MAXPUSHDavid Mitchell2016-02-031-3/+7
| | | | | | | | | | | | | | | | The newer SS_ADD macros expect there to always be SS_MAXPUSH slots free on the savestack; so they can push multiple items, then only check once at the end whether stack needs expanding. This commit makes savestack_grow() set PL_savestack_max to SS_MAXPUSH short of what has actually been allocated. This makes the tests to see whether the stack needs growing slightly simpler, i.e. PL_savestack_ix > PL_savestack_max rather than PL_savestack_ix + SS_MAXPUSH > PL_savestack_max
* add SAVEt_TMPSFLOOR save type and Perl_savetmps()David Mitchell2016-02-031-0/+15
| | | | | | | | By making SAVETMPS have its own dedicated save type, it avoids having to push the address of PL_tmps_floor onto the save stack each time. By also giving it a dedicated save function, the function can do the PL_tmpsfloor = PL_tmps_ix step too, making the binary slightly more compact.
* rename PUSHBLOCK,PUSHSUB etc to CX_PUSHBLOCK etcDavid Mitchell2016-02-031-1/+1
| | | | | | | Earlier all the POPFOO macros were renamed to CX_POPFOO to reflect the changed API (like POPBLOCK no longer decremented cxstack_ix). Now rename the PUSH ones for consistency.
* rename POPFOO() to CX_POPFOO()David Mitchell2016-02-031-3/+5
| | | | | | | | | | | | | | | | Rename all the context-popping macros such as POPBLOCK and POPSUB, by giving them a CX_ prefix. (Do TOPBLOCK too). This is principally to deliberately break any existing non-core use of these non-API macros, as their behaviour has changed in this branch. In particular, POPBLOCK(cx) no longer decrements the cxt stack pointer nor sets cx; instead, cx is now expected to already point to the stack frame which POPBLOCK should process. At the same time, giving them a CX_ prefix makes it clearer that these are all part of a family of macros that manipulate the context stack. The PUSHFOO() macros will be renamed in a later commit.
* Perl_free_tmps(): don't test for PL_sv_undefDavid Mitchell2016-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | Each sv being popped off the tmps stack is compared against PL_sv_undef, and if so, the SvTEMP_off(sv); SvREFCNT_dec_NN(sv); is skipped. This condition was added by 8aacddc1 back in 2001, as part of a commit to add support for hash placeholders. Initially it used &PL_sv_undef in HE value slots to indicate a placeholder. In a later commit, that was changed to &PL_sv_placeholder, but the test in free_tmps() continued to test against &PL_sv_undef. Im not sure what the original intent was, but I strongly suspect that whatever purpose it may have originally served, it no longer served that after the switch to PL_sv_placeholder. On a purely pragmatic note, I can't see any harm in untemping PL_sv_undef; at worst its ref count will occasionally reach 0, and the special code in sv_free2() will reset its count to SvREFCNT_IMMORTAL. And no tests fail....
* move and rename cx_old_savestack_ixDavid Mitchell2016-02-031-0/+1
| | | | | | | | | | | Earlier on in this branch I temporarily added cx_old_savestack_ix as the first element in the context struct. This commit moves it down 32 bits so it now follows type/gimme/u16 in the sbu and blku unions. This means that type is now back as the first item in the struct. I've also renamed it blku_oldsaveix to be more in keeping with similar field names.
* PUSHLOOP_PLAIN: don't set unused fieldsDavid Mitchell2016-02-031-7/+11
| | | | | | | | Currently PUSHLOOP_PLAIN sets a whole unch of fields that it isn't going to ue to NULL or 0, e.g. blk_loop.itersave. Skip this and leave them wild. Make cx_dump() not try to dump them for CXt_LOOP_PLAIN
* Eliminate cx->blk_loop.resetspDavid Mitchell2016-02-031-2/+0
| | | | | | | | | | | | | | | Of all the loop types, only CXt_LOOP_LIST, i.e. for (1,2,3) {}, needs to keep anything on the stack, i.e. for all the others, cx->blk_loop.resetsp can always equal cx->blk_oldsp. For CXt_LOOP_LIST, the same value as resetsp is stored as blk_loop.state_u.stack.basesp. So we can eliminate the resetsp field. This is good as the loop substruct is the largest (ITHREADS) or joint largest with eval (non-threaded). Also, we now don't have to store that value for non-CXt_LOOP_LIST loops. The downside is we now have to choose between basesp and oldsp in pp_leaveloop and pp_last, based on CX type.
* split CXt_LOOP_FOR into CXt_LOOP_LIST,CXt_LOOP_ARYDavid Mitchell2016-02-031-2/+3
| | | | | | | | | | | | | | | Create a new context type so that "for (1,2,3)" and "for (@ary)" are now two separate types. For the list type, we store the index of the base stack element in the state union rather than having an array pointer. Currently this is just the same as blk_resetsp, but this will shortly allow us to eliminate the resetsp field from the struct block_loop - which is currently the largest sub-struct within the block union. Having two separate types also allows the two cases to be handled directly in the main switch in the hot pp_iter code, rather than having extra conditionals.
* remove vestigial uses of PRIVSHIFTDavid Mitchell2016-01-191-9/+6
| | | | | | | | | | | | | | | | | | | | | | | This is a hangover from when a magic (e.g. tied) var, after calling mg_get(), would only set the private (SVp_IOK,SVp_NOK,SVp_POK) flags on the result, indicating that although it now had a valid integer value (say), it wasn't a "real" integer. This was achieved by, after calling mg_get(), shifting all the public flags by PRIVSHIFT to convert them to private flags. Since 5.18.0, that's not been the case (i.e. mg_get() on a tied var leaves Svf_IOK etc set). But there are still a couple of vestigial uses of PRIVSHIFT in the core, and this commit removes them. For one of them, I added a test that shows that (in slightly contrived circumnstances), it was possible for a SVp_IOK NV to be upgraded to a SVf_IOK int on return from localisation, losing its fractional component. The other one, in S_sv_unmagicext_flags(), only seemed to get called when setting a new value (e.g. from mg_set()), so its unlikely that such a var would still have private flags set that could be incorrectly upgraded to public.
* document save_gp() and the GVf_INTRO flagTony Cook2015-12-171-0/+13
|
* avoid leaks when calling mg_set() in leave_scope()David Mitchell2015-12-111-7/+18
| | | | | | | | | | | | | | | | | | | In leave_scope() in places like SAVEt_SV, it does stuff like if (SvSMAGICAL(...)) mg_set(...) SvREFCNT_dec_NN(ARG0_SV) If mg_set() dies (e.g. it calls STORE() and STORE() dies), then ARG0_SV would leak. Fix this by putting ARG0_SV back in the save stack in this case. A similar thing applies to SAVEt_AV and SAVEt_HV, but I couldn't think of a simple test for those, as tied array and hashes don't have set magic (just RMG). Also, SAVEt_AV and SAVEt_HV share a lot of common code, so I made SAVEt_HV goto into the SAVEt_AV code block for the common part.
* markstack_grow(): fix debugging stuffDavid Mitchell2015-12-021-2/+3
| | | | | | | | This is a follow-on to commit ac07059afc75: FOOMARK debugging macros: fix %d cast; only -Dsv which missed fixing up the debugging statement in markstack_grow().
* MARK -Ds debuggingReini Urban2015-11-101-0/+2
| | | | | display the MARK arity and pointers with MARK macros. assert on markptr underflow.
* RT: #126309 die more gracefully on (1) x ~1David Mitchell2015-10-281-4/+18
| | | | | | | | | | | | | | | | Recent improvements to MEXTEND() etc means that the above is now caught and panics rather than crashing. However, the panic is: panic: av_extend_guts() negative count (-9223372036854775681) which is safe, but not pretty. This commit makes it croak instead with: Out of memory during stack extend Basically Perl_stack_grow() adds an extra 128 bytes of headroom to the amount it actually extends the stack by. Check in stack_grow() itself whether this has wrapped, rather than leaving it to av_extend_guts(), which can only give a generic panic message.