diff options
-rw-r--r-- | ext/B/B/Concise.pm | 2 | ||||
-rw-r--r-- | ext/B/t/optree_constants.t | 4 | ||||
-rw-r--r-- | ext/B/t/optree_specials.t | 72 | ||||
-rw-r--r-- | lib/strict.pm | 6 | ||||
-rw-r--r-- | op.h | 4 | ||||
-rw-r--r-- | perl.h | 15 |
6 files changed, 53 insertions, 50 deletions
diff --git a/ext/B/B/Concise.pm b/ext/B/B/Concise.pm index 49a4c167b0..6db2e0ce95 100644 --- a/ext/B/B/Concise.pm +++ b/ext/B/B/Concise.pm @@ -668,7 +668,7 @@ $priv{$_}{128} = '+1' for qw "caller wantarray runcv"; our %hints; # used to display each COP's op_hints values # strict refs, subs, vars -@hints{2,512,1024,2<<28,4<<28,8<<28} = ('$', '&', '*', 'x$', 'x&', 'x*'); +@hints{2,512,1024,32,64,128} = ('$', '&', '*', 'x$', 'x&', 'x*'); # integers, locale, bytes @hints{1,4,8,16} = ('i', 'l', 'b'); # block scope, localise %^H, $^OPEN (in), $^OPEN (out) diff --git a/ext/B/t/optree_constants.t b/ext/B/t/optree_constants.t index 7c04b22f26..ebcf042d10 100644 --- a/ext/B/t/optree_constants.t +++ b/ext/B/t/optree_constants.t @@ -181,12 +181,12 @@ EONT_EONT my ($expect, $expect_nt) = (<<'EOT_EOT', <<'EONT_EONT'); # 3 <1> leavesub[2 refs] K/REFC,1 ->(end) # - <@> lineseq K ->3 -# 1 <;> nextstate(constant 61 constant.pm:118) v:x*,x&,x$,*,& ->2 +# 1 <;> nextstate(constant 61 constant.pm:118) v:*,&,x*,x&,x$ ->2 # 2 <0> padav[@list:FAKE:m:96] ->3 EOT_EOT # 3 <1> leavesub[2 refs] K/REFC,1 ->(end) # - <@> lineseq K ->3 -# 1 <;> nextstate(constant 61 constant.pm:118) v:x*,x&,x$,*,& ->2 +# 1 <;> nextstate(constant 61 constant.pm:118) v:*,&,x*,x&,x$ ->2 # 2 <0> padav[@list:FAKE:m:71] ->3 EONT_EONT diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t index 5af6bd2501..567a9054aa 100644 --- a/ext/B/t/optree_specials.t +++ b/ext/B/t/optree_specials.t @@ -49,10 +49,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 1: # a <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->a -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->2 +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->2 # 3 <1> require sK/1 ->4 # 2 <$> const[PV "strict.pm"] s/BARE ->3 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->5 +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->5 # - <@> lineseq K ->- # - <0> null ->5 # 9 <1> entersub[t1] KS*/TARG,2 ->a @@ -63,10 +63,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 2: # k <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq K ->k -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->c +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->c # d <1> require sK/1 ->e # c <$> const[PV "strict.pm"] s/BARE ->d -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->f +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->f # - <@> lineseq K ->- # - <0> null ->f # j <1> entersub[t1] KS*/TARG,2 ->k @@ -77,10 +77,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 3: # u <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->u -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->m +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->m # n <1> require sK/1 ->o # m <$> const[PV "warnings.pm"] s/BARE ->n -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->p +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->p # - <@> lineseq K ->- # - <0> null ->p # t <1> entersub[t1] KS*/TARG,2 ->u @@ -99,10 +99,10 @@ EOT_EOT # BEGIN 1: # a <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->a -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->2 +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->2 # 3 <1> require sK/1 ->4 # 2 <$> const(PV "strict.pm") s/BARE ->3 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->5 +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->5 # - <@> lineseq K ->- # - <0> null ->5 # 9 <1> entersub[t1] KS*/TARG,2 ->a @@ -113,10 +113,10 @@ EOT_EOT # BEGIN 2: # k <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq K ->k -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->c +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->c # d <1> require sK/1 ->e # c <$> const(PV "strict.pm") s/BARE ->d -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->f +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->f # - <@> lineseq K ->- # - <0> null ->f # j <1> entersub[t1] KS*/TARG,2 ->k @@ -127,10 +127,10 @@ EOT_EOT # BEGIN 3: # u <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->u -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->m +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->m # n <1> require sK/1 ->o # m <$> const(PV "warnings.pm") s/BARE ->n -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->p +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->p # - <@> lineseq K ->- # - <0> null ->p # t <1> entersub[t1] KS*/TARG,2 ->u @@ -248,10 +248,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 2 <$> const[PV "strict.pm"] s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 5 <0> pushmark s # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM @@ -259,10 +259,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # c <$> const[PV "strict.pm"] s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # f <0> pushmark s # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM @@ -270,10 +270,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # m <$> const[PV "warnings.pm"] s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # p <0> pushmark s # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM @@ -307,10 +307,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # 1e <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 2 <$> const(PV "strict.pm") s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 5 <0> pushmark s # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM @@ -318,10 +318,10 @@ EOT_EOT # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # c <$> const(PV "strict.pm") s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # f <0> pushmark s # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM @@ -329,10 +329,10 @@ EOT_EOT # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # m <$> const(PV "warnings.pm") s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # p <0> pushmark s # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM @@ -377,10 +377,10 @@ checkOptree ( name => 'regression test for patch 25352', @warnings_todo, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 2 <$> const[PV "strict.pm"] s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 5 <0> pushmark s # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM @@ -388,10 +388,10 @@ checkOptree ( name => 'regression test for patch 25352', # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # c <$> const[PV "strict.pm"] s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # f <0> pushmark s # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM @@ -399,10 +399,10 @@ checkOptree ( name => 'regression test for patch 25352', # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # m <$> const[PV "warnings.pm"] s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # p <0> pushmark s # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM @@ -411,10 +411,10 @@ checkOptree ( name => 'regression test for patch 25352', # u <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 2 <$> const(PV "strict.pm") s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ # 5 <0> pushmark s # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM @@ -422,10 +422,10 @@ EOT_EOT # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # c <$> const(PV "strict.pm") s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ # f <0> pushmark s # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM @@ -433,10 +433,10 @@ EOT_EOT # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # m <$> const(PV "warnings.pm") s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ # p <0> pushmark s # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM diff --git a/lib/strict.pm b/lib/strict.pm index 43b7ebf3fa..63a89dd8f4 100644 --- a/lib/strict.pm +++ b/lib/strict.pm @@ -15,9 +15,9 @@ subs => 0x00000200, vars => 0x00000400 ); my %explicit_bitmask = ( -refs => 0x20000000, -subs => 0x40000000, -vars => 0x80000000 +refs => 0x00000020, +subs => 0x00000040, +vars => 0x00000080 ); sub bits { @@ -163,8 +163,8 @@ Deprecated. Use C<GIMME_V> instead. /* Lower bits of op_private often carry the number of arguments, as * set by newBINOP, newUNOP and ck_fun */ -/* NOTE: OP_NEXTSTATE and OP_DBSTATE (i.e. COPs) carry lower - * bits of PL_hints in op_private */ +/* NOTE: OP_NEXTSTATE and OP_DBSTATE (i.e. COPs) carry NATIVE_HINTS + * in op_private */ /* Private for lvalues */ #define OPpLVAL_INTRO 128 /* Lvalue must be localized or lvalue sub */ @@ -4818,8 +4818,10 @@ typedef enum { #define HINT_LOCALE 0x00000004 /* locale pragma */ #define HINT_BYTES 0x00000008 /* bytes pragma */ #define HINT_LOCALE_NOT_CHARS 0x00000010 /* locale ':not_characters' pragma */ - /* Note: 20,40,80 used for NATIVE_HINTS */ - /* currently defined by vms/vmsish.h */ + +#define HINT_EXPLICIT_STRICT_REFS 0x00000020 /* strict.pm */ +#define HINT_EXPLICIT_STRICT_SUBS 0x00000040 /* strict.pm */ +#define HINT_EXPLICIT_STRICT_VARS 0x00000080 /* strict.pm */ #define HINT_BLOCK_SCOPE 0x00000100 #define HINT_STRICT_SUBS 0x00000200 /* strict pragma */ @@ -4848,10 +4850,11 @@ typedef enum { #define HINT_FEATURE_MASK 0x1c000000 /* 3 bits for feature bundles */ -#define HINT_EXPLICIT_STRICT_REFS 0x20000000 /* strict.pm */ -#define HINT_EXPLICIT_STRICT_SUBS 0x40000000 /* strict.pm */ -#define HINT_EXPLICIT_STRICT_VARS 0x80000000 /* strict.pm */ - + /* Note: Used for NATIVE_HINTS, currently + defined by vms/vmsish.h: + 0x40000000 + 0x80000000 + */ /* The following are stored in $^H{sort}, not in PL_hints */ #define HINT_SORT_SORT_BITS 0x000000FF /* allow 256 different ones */ |