This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix crash in leave_scope when my sub has CvGV
[perl5.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index aa63504..bfde692 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1495,8 +1495,10 @@ S_to_lower_latin1(const U8 c, U8* p, STRLEN *lenp)
            *lenp = 1;
        }
        else {
-           *p = UTF8_TWO_BYTE_HI(converted);
-           *(p+1) = UTF8_TWO_BYTE_LO(converted);
+            /* Result is known to always be < 256, so can use the EIGHT_BIT
+             * macros */
+           *p = UTF8_EIGHT_BIT_HI(converted);
+           *(p+1) = UTF8_EIGHT_BIT_LO(converted);
            *lenp = 2;
        }
     }