summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Fcntl/Fcntl.pm2
-rw-r--r--op.c11
-rwxr-xr-xt/comp/proto.t9
-rw-r--r--toke.c7
4 files changed, 21 insertions, 8 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index 6214323c31..74de3dfc65 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -78,7 +78,7 @@ $VERSION = "1.03";
sub AUTOLOAD {
my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
- my $val = constant($constname, @_ ? $_[0] : 0);
+ my $val = constant($constname, (@_ && (caller(0))[4]) ? $_[0] : 0);
if ($! != 0) {
if ($! =~ /Invalid/) {
$AutoLoader::AUTOLOAD = $AUTOLOAD;
diff --git a/op.c b/op.c
index 3cff0b28b0..90c604d40f 100644
--- a/op.c
+++ b/op.c
@@ -1645,6 +1645,12 @@ fold_constants(register OP *o)
case OP_LCFIRST:
case OP_UC:
case OP_LC:
+ case OP_SLT:
+ case OP_SGT:
+ case OP_SLE:
+ case OP_SGE:
+ case OP_SCMP:
+
if (o->op_private & OPpLOCALE)
goto nope;
}
@@ -4599,9 +4605,10 @@ ck_subr(OP *o)
goto wrapref;
{
OP* kid = o2;
- o2 = newUNOP(OP_RV2GV, 0, kid);
- o2->op_sibling = kid->op_sibling;
+ OP* sib = kid->op_sibling;
kid->op_sibling = 0;
+ o2 = newUNOP(OP_RV2GV, 0, kid);
+ o2->op_sibling = sib;
prev->op_sibling = o;
}
goto wrapref;
diff --git a/t/comp/proto.t b/t/comp/proto.t
index d1cfede8af..080110bdcc 100755
--- a/t/comp/proto.t
+++ b/t/comp/proto.t
@@ -362,17 +362,18 @@ printf "ok %d\n",$i++;
##
##
-testing \&an_array_ref, '\@';
+testing \&array_ref_plus, '\@@';
-sub an_array_ref (\@) {
+sub array_ref_plus (\@@) {
print "# \@_ = (",join(",",@_),")\n";
- print "not " unless ref($_[0]) && 1 == @{$_[0]};
+ print "not " unless @_ == 2 && ref($_[0]) && 1 == @{$_[0]} && $_[1] eq 'x';
printf "ok %d\n",$i++;
@{$_[0]} = (qw(ok)," ",$i++,"\n");
}
@array = ('a');
-an_array_ref @array;
+{ my @more = ('x');
+ array_ref_plus @array, @more; }
print "not " unless @array == 4;
print @array;
diff --git a/toke.c b/toke.c
index 51111d142f..4547ad0b3e 100644
--- a/toke.c
+++ b/toke.c
@@ -2014,8 +2014,13 @@ yylex(void)
else
lex_brackstack[lex_brackets++] = XOPERATOR;
s = skipspace(s);
- if (*s == '}')
+ if (*s == '}') {
+ if (expect == XSTATE) {
+ lex_brackstack[lex_brackets-1] = XSTATE;
+ break;
+ }
OPERATOR(HASHBRACK);
+ }
/* This hack serves to disambiguate a pair of curlies
* as being a block or an anon hash. Normally, expectation
* determines that, but in cases where we're not in a