+0.06 --
+ * Do not change the string arg in XS, use copy instead. Fixes perlcc -O3
+ RT#96893 (Reini Urban)
+
0.05 -- Wed Sep 8 00:51 CEST 2010
* Stop using the padlist to refcount GVs. Instead use regular magic. This
allows various modules, including B::Deparse, to safely peek into pads of
/* Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
+ * Copyright (C) 2014, cPanel Inc. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the same terms as Perl itself.
*/
CV *cv = NULL;
GV *gv;
HV *stash = CopSTASH(PL_curcop);
- char *s, *end = NULL, saved;
+ char *s, *end = NULL;
MAGIC *mg;
PPCODE:
if (!SvROK(sub) && SvGMAGICAL(sub))
end = s;
}
s--;
- if (end) {
- saved = *end;
- *end = 0;
- stash = GvHV(gv_fetchpv(name, TRUE, SVt_PVHV));
- *end = saved;
- name = end;
- }
+ if (end) {
+ stash = GvHV(gv_fetchpv(savepvn(name, end - name), TRUE, SVt_PVHV));
+ name = end;
+ }
gv = (GV *) newSV(0);
gv_init(gv, stash, name, s - name, TRUE);
AUTHOR
Matthijs van Duin <xmath@cpan.org>
- Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved. This
- program is free software; you can redistribute it and/or modify it under
- the same terms as Perl itself.
+ Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
+ Copyright (C) 2014 cPanel Inc. All rights reserved. This program is free
+ software; you can redistribute it and/or modify it under the same terms
+ as Perl itself.
+
Matthijs van Duin <xmath@cpan.org>
Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
+Copyright (C) 2014 cPanel Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
--- /dev/null
+use strict;
+use warnings;
+
+eval "use B::C;";
+if ($@) {
+ print "1..0 #SKIP B::C required for testing perlcc -O3\n";
+ exit;
+} else {
+ print "1..1\n";
+}
+
+my $f = "t/rt96893x.pl";
+open my $fh, ">", $f; END { unlink $f }
+print $fh 'use Sub::Name; subname("main::bar", sub{42}); print "ok 1\n";';
+close $fh;
+
+system($^X, qw(-Mblib -S perlcc -O3 -UCarp -UConfig -r), $f);
+
+unlink "t/rt96893x", "t/rt96893x.exe";
+# vim: ft=perl