]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Remove dead stores to 'size' in UTF-8 decoder (unicodeobject.c) (GH-140637...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 27 Oct 2025 09:21:43 +0000 (10:21 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Oct 2025 09:21:43 +0000 (09:21 +0000)
Remove dead stores to 'size' in UTF-8 decoder (unicodeobject.c) (GH-140637)
(cherry picked from commit 7d70a147f58edabc9691869a0e8b606c9c3ac184)

Co-authored-by: Shamil <ashm.tech@proton.me>
Objects/unicodeobject.c

index 0ff2d71924ff9ce57795c329ada5e761ee29f6b5..c71c5720ea090e275224c5593502a261dec40815 100644 (file)
@@ -5497,7 +5497,6 @@ unicode_decode_utf8(const char *s, Py_ssize_t size,
     if (maxchr <= 255) {
         memcpy(PyUnicode_1BYTE_DATA(u), s, pos);
         s += pos;
-        size -= pos;
         writer.pos = pos;
     }
 
@@ -5545,7 +5544,6 @@ unicode_decode_utf8_writer(_PyUnicodeWriter *writer,
             return 0;
         }
         s += decoded;
-        size -= decoded;
     }
 
     return unicode_decode_utf8_impl(writer, starts, s, end,