Do not constant-fold ops that depend on locale if C<use locale>
Chip Salzenberg [Wed, 6 Aug 1997 12:00:00 +0000 (00:00 +1200)]
p5p-msgid: 199707210519.BAA13785@nielsenmedia.com

op.c

diff --git a/op.c b/op.c
index d412bcf..b8f363c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1553,6 +1553,16 @@ register OP *o;
     if (!(opargs[type] & OA_FOLDCONST))
        goto nope;
 
+    switch (type) {
+    case OP_SPRINTF:
+    case OP_UCFIRST:
+    case OP_LCFIRST:
+    case OP_UC:
+    case OP_LC:
+       if (o->op_private & OPpLOCALE)
+           goto nope;
+    }
+
     if (error_count)
        goto nope;              /* Don't try to run w/ errors */