/[pkgs]/devel/perl/31_fix_attributes_unknown_error
ViewVC logotype

Contents of /devel/perl/31_fix_attributes_unknown_error

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Mar 11 22:01:05 2009 UTC (8 months, 1 week ago) by spot
Branch: MAIN
CVS Tags: F-12-split, perl-5_10_0-63_fc11, perl-5_10_0-61_fc11, perl-5_10_0-80_fc12, perl-5_10_0-81_fc12, perl-5_10_0-84_fc13, perl-5_10_0-82_fc13, perl-5_10_0-77_fc12, perl-5_10_0-83_fc13, perl-5_10_0-71_fc12, perl-5_10_0-75_fc12, perl-5_10_0-73_fc12, perl-5_10_0-68_fc11, perl-5_10_0-67_fc11, perl-5_10_0-64_fc11, perl-5_10_0-72_fc12, F-11-split, perl-5_10_0-62_fc11, perl-5_10_0-69_fc12, perl-5_10_0-79_fc12, perl-5_10_0-78_fc12, perl-5_10_0-70_fc12, perl-5_10_0-74_fc12, perl-5_10_0-66_fc11, perl-5_10_0-65_fc11, perl-5_10_0-76_fc12, HEAD
reorder @INC, fix bz 489204, merge useful debian patches
1 Fix 'Unknown error' messages with attribute.pm. (Closes: #488088)
2
3 [perl #49472]
4 blead change 33265
5
6 From: Dave Mitchell <davem@fdisolutions.com>
7 Date: Sat, 9 Feb 2008 14:56:23 +0000
8 Subject: [PATCH] [perl #49472] Attributes + Unkown Error
9 An errored attribute sub still processes the attributes,
10 which require's attribute.pm, so make sure the error state is
11 passed to the new require
12
13 p4raw-id: //depot/perl@33265
14 ---
15 t/comp/require.t | 16 +++++++++++++++-
16 toke.c | 1 +
17 2 files changed, 16 insertions(+), 1 deletions(-)
18
19 diff --git a/t/comp/require.t b/t/comp/require.t
20 index af5e4b2..0746b3b 100755
21 --- a/t/comp/require.t
22 +++ b/t/comp/require.t
23 @@ -15,7 +15,7 @@ krunch.pm krunch.pmc whap.pm whap.pmc);
24
25 my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
26 my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/;
27 -my $total_tests = 49;
28 +my $total_tests = 50;
29 if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; }
30 print "1..$total_tests\n";
31
32 @@ -258,6 +258,20 @@ EOT
33 }
34 }
35
36 +# [perl #49472] Attributes + Unkown Error
37 +
38 +{
39 + do_require
40 + 'use strict;sub MODIFY_CODE_ATTRIBUTE{} sub f:Blah {$nosuchvar}';
41 + my $err = $@;
42 + $err .= "\n" unless $err =~ /\n$/;
43 + unless ($err =~ /Global symbol "\$nosuchvar" requires /) {
44 + $err =~ s/^/# /mg;
45 + print "${err}not ";
46 + }
47 + print "ok ", ++$i, " [perl #49472]\n";
48 +}
49 +
50 ##########################################
51 # What follows are UTF-8 specific tests. #
52 # Add generic tests before this point. #
53 diff --git a/toke.c b/toke.c
54 index 2ae8b75..ecee902 100644
55 --- a/toke.c
56 +++ b/toke.c
57 @@ -692,6 +692,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, bool new_filter)
58 #else
59 parser->nexttoke = 0;
60 #endif
61 + parser->error_count = oparser ? oparser->error_count : 0;
62 parser->copline = NOLINE;
63 parser->lex_state = LEX_NORMAL;
64 parser->expect = XSTATE;
65 --
66 1.5.6.5
67

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2