diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2015-12-21 19:25:32 +0000 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2016-01-16 21:45:16 -0500 |
commit | e1ccd2206d2572b12ff2ad8efe6b1370c580898f (patch) | |
tree | 9bf4f131bd3487cf4e91e856501816df1bdd6567 /t | |
parent | cda27dcf504146747d450c00da849d80744fdf7d (diff) | |
download | perl-e1ccd2206d2572b12ff2ad8efe6b1370c580898f.tar.gz |
Enforce strict 'subs' in multideref optimisation
The code that checks constant keys and turns them into HEKs swallowed
the OP_CONST before the strictness checker could get to it, thus
allowing barewords when they should not be.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/strict/subs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/lib/strict/subs b/t/lib/strict/subs index 095adee4cf..bad22c6a46 100644 --- a/t/lib/strict/subs +++ b/t/lib/strict/subs @@ -458,3 +458,13 @@ use strict 'subs'; EXPECT Bareword "FOO" not allowed while "strict subs" in use at - line 3. Execution of - aborted due to compilation errors. +######## +# [perl #126981] Strict subs vs. multideref +sub CONST () { 'some_key' } +my $h; +my $v1 = $h->{+CONST_TYPO}; +use strict 'subs'; +my $v2 = $h->{+CONST_TYPO}; +EXPECT +Bareword "CONST_TYPO" not allowed while "strict subs" in use at - line 6. +Execution of - aborted due to compilation errors. |