This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Don't fold constant fc() in locale
authorKarl Williamson <public@khwilliamson.com>
Sat, 4 May 2013 22:09:39 +0000 (16:09 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 May 2013 17:01:50 +0000 (11:01 -0600)
We do compile time folding of calls to ops with constant parameters.
This should be skipped if the op's result depends on locale, and it is
being called from within the scope of 'use locale', as the result is not
known until runtime.  fc() was folding anyway.

There is no test, as this only shows up when run in a locale that it
makes a difference in, and there is no guarantee that such a locale
would occur on any computer, and it is a real pain to go searching
through the computer's available locales for such a one for just this
error.

op.c

diff --git a/op.c b/op.c
index 8457869..3bdbdf6 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3229,6 +3229,7 @@ S_fold_constants(pTHX_ OP *o)
     case OP_LCFIRST:
     case OP_UC:
     case OP_LC:
+    case OP_FC:
     case OP_SLT:
     case OP_SGT:
     case OP_SLE: