From e6798126b96281772d88475d1addfe53f30e42d2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 13 Oct 2004 04:26:48 +0000 Subject: disallow the use of the return value of push and unshift --- perl_checker.src/parser_helper.ml | 2 +- perl_checker.src/test/return_value.t | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 8d238ed..0be9353 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -362,7 +362,7 @@ let function_to_context word_alone = function | "each_index" -> M_none | "N" | "N_" -> M_string - | "chop" | "chomp" -> M_none + | "chop" | "chomp" | "push" | "unshift" -> M_none | "hex" | "length" | "time" | "fork" | "getppid" -> M_int | "eof" | "wantarray" -> M_int | "stat" | "lstat" -> M_list diff --git a/perl_checker.src/test/return_value.t b/perl_checker.src/test/return_value.t index fd8eafd..cae8652 100644 --- a/perl_checker.src/test/return_value.t +++ b/perl_checker.src/test/return_value.t @@ -15,3 +15,5 @@ map { xxx($_) } @l; if you don't use the return value, use $xxx = chomp; () context not accepted here context () is not compatible with context scalar +$xxx = push @l, 1 () context not accepted here + context () is not compatible with context scalar -- cgit v1.2.1