diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-09-03 16:47:15 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-09-04 11:08:38 +0200 |
commit | 7bbbc3c08a8830fe5d44ce7a6056cfba6fb67c22 (patch) | |
tree | 17d3ee1a96dba24e2464607b7075ab64f9701717 /mg.c | |
parent | 83519873101c5088b6e33e85da400d6f575c0ceb (diff) | |
download | perl-7bbbc3c08a8830fe5d44ce7a6056cfba6fb67c22.tar.gz |
Perl_magic_setdbline() should clear and set read-only OP slabs.
The debugger implements breakpoints by setting/clearing OPf_SPECIAL on
OP_DBSTATE ops. This means that it is writing to the optree at runtime,
and it falls foul of the enforced read-only OP slabs when debugging with
-DPERL_DEBUG_READONLY_OPS
Avoid this by removing static from Slab_to_rw(), and using it and Slab_to_ro()
in Perl_magic_setdbline() to temporarily make the slab re-write whilst
changing the breakpoint flag.
With this all tests pass with -DPERL_DEBUG_READONLY_OPS (on this system)
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2020,11 +2020,17 @@ Perl_magic_setdbline(pTHX_ SV *sv, MAGIC *mg) if (svp && SvIOKp(*svp)) { OP * const o = INT2PTR(OP*,SvIVX(*svp)); if (o) { +#ifdef PERL_DEBUG_READONLY_OPS + Slab_to_rw(OpSLAB(o)); +#endif /* set or clear breakpoint in the relevant control op */ if (i) o->op_flags |= OPf_SPECIAL; else o->op_flags &= ~OPf_SPECIAL; +#ifdef PERL_DEBUG_READONLY_OPS + Slab_to_ro(OpSLAB(o)); +#endif } } return 0; |