aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-10-15 16:11:55 +0200
committerBjörn Gustavsson <[email protected]>2012-10-15 16:29:12 +0200
commit21ca6d3a137034f19862db769a5b7f1c5528dbc4 (patch)
tree0eddd432e668bde07492e576abdebe55fca3e685 /erts/emulator
parent8b201631300556d5e93556062f7a615cdd1a6708 (diff)
downloadotp-21ca6d3a137034f19862db769a5b7f1c5528dbc4.tar.gz
otp-21ca6d3a137034f19862db769a5b7f1c5528dbc4.tar.bz2
otp-21ca6d3a137034f19862db769a5b7f1c5528dbc4.zip
beam_makeops: Eliminate a deprecation warning
Perl 5.16.1 (and perhaps other versions) issues the following warning: defined(@array) is deprecated at utils/beam_makeops line 1714. (Maybe you should just omit the defined()?) for the following line: $prev_last = pop(@{$gen_transform{$key}}) if defined @{$gen_transform{$key}}; # LINE 1714 The documentation for "defined" says that its use on hashes and arrays is deprecated and that it may stop working in a future release. Simply removing "defined" (as suggested by the warning message) will not work, as there will be an error when trying to use an undefined value as an array reference: Can't use an undefined value as an ARRAY reference at utils/beam_makeops line 1714. What we must do is to check whether $gen_transform{$key} is defined before trying to use it as an array reference. Noticed-by: Tuncer Ayaz
Diffstat (limited to 'erts/emulator')
-rwxr-xr-xerts/emulator/utils/beam_makeops2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index 8fe2402ca8..8abe454cd1 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -1711,7 +1711,7 @@ sub tr_gen_to {
my $prev_last;
$prev_last = pop(@{$gen_transform{$key}})
- if defined @{$gen_transform{$key}}; # Fail
+ if defined $gen_transform{$key}; # Fail
if ($prev_last && !is_instr($prev_last, 'fail')) {
error("Line $line: A previous transformation shadows '$orig_transform'");