diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:35:14 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:35:14 +0000 |
commit | 841ae5884be4af07785a35eff4afc1a031fcde43 (patch) | |
tree | 4ea29b8aa02904421bc104031677b0a7d2bb3b20 /perl_checker.src/global_checks.ml | |
parent | 0a03f42eb1d5ec02424d78b63d9fc2bd1f8b2e74 (diff) | |
download | perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.gz perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.bz2 perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.xz perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.zip |
- correctly handle "shift" with no parameter at toplevel
- remove (hopefully) unused code rewriting shift -> shift(@_)
Diffstat (limited to 'perl_checker.src/global_checks.ml')
-rw-r--r-- | perl_checker.src/global_checks.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perl_checker.src/global_checks.ml b/perl_checker.src/global_checks.ml index 6e7b46c..0c45783 100644 --- a/perl_checker.src/global_checks.ml +++ b/perl_checker.src/global_checks.ml @@ -281,6 +281,9 @@ let check_variables vars t = | Call(Deref(I_func, Ident(None, "require", _)), [Ident _]) -> Some vars + | Call(Deref(I_func, Ident(None, "shift", pos)) as var, []) -> + check vars (Call(var, [ Deref(I_array, Ident(None, (if vars.is_toplevel then "ARGV" else "_"), pos)) ])) + | Call(Deref(context, (Ident(_, _, pos) as var)), para) -> check_variable (context, var) vars (Some(pos, para)) ; let vars = List.fold_left check_variables_ vars para in |