[3.11] Fix the long64 reader in umarshal.py (GH-107828) (GH-107850)

(cherry picked from commit 50bbc56009)

Co-authored-by: Martin DeMello <martindemello@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-08-10 14:10:46 -07:00 committed by GitHub
parent fb08b7905e
commit 202efe1a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -125,10 +125,10 @@ def r_long64(self) -> int:
x |= buf[1] << 8
x |= buf[2] << 16
x |= buf[3] << 24
x |= buf[1] << 32
x |= buf[1] << 40
x |= buf[1] << 48
x |= buf[1] << 56
x |= buf[4] << 32
x |= buf[5] << 40
x |= buf[6] << 48
x |= buf[7] << 56
x |= -(x & (1<<63)) # Sign-extend
return x