Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
33d2a492
Commit
33d2a492
authored
Sep 06, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promote some shifts to unsigned, so as not to invoke undefined behavior
parent
4a757609
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Objects/unicodeobject.c
Objects/unicodeobject.c
+3
-3
No files found.
Objects/unicodeobject.c
View file @
33d2a492
...
...
@@ -4944,7 +4944,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
mark is skipped, in all other modes, it is copied to the output
stream as-is (giving a ZWNBSP character). */
if
(
bo
==
0
&&
size
>=
4
)
{
Py_UCS4
bom
=
(
q
[
3
]
<<
24
)
|
(
q
[
2
]
<<
16
)
|
(
q
[
1
]
<<
8
)
|
q
[
0
];
Py_UCS4
bom
=
(
(
unsigned
int
)
q
[
3
]
<<
24
)
|
(
q
[
2
]
<<
16
)
|
(
q
[
1
]
<<
8
)
|
q
[
0
];
if
(
bom
==
0x0000FEFF
)
{
bo
=
-
1
;
q
+=
4
;
...
...
@@ -4986,7 +4986,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
Py_ssize_t
pos
=
writer
.
pos
;
if
(
le
)
{
do
{
ch
=
(
q
[
3
]
<<
24
)
|
(
q
[
2
]
<<
16
)
|
(
q
[
1
]
<<
8
)
|
q
[
0
];
ch
=
(
(
unsigned
int
)
q
[
3
]
<<
24
)
|
(
q
[
2
]
<<
16
)
|
(
q
[
1
]
<<
8
)
|
q
[
0
];
if
(
ch
>
maxch
)
break
;
if
(
kind
!=
PyUnicode_1BYTE_KIND
&&
...
...
@@ -4998,7 +4998,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
}
else
{
do
{
ch
=
(
q
[
0
]
<<
24
)
|
(
q
[
1
]
<<
16
)
|
(
q
[
2
]
<<
8
)
|
q
[
3
];
ch
=
(
(
unsigned
int
)
q
[
0
]
<<
24
)
|
(
q
[
1
]
<<
16
)
|
(
q
[
2
]
<<
8
)
|
q
[
3
];
if
(
ch
>
maxch
)
break
;
if
(
kind
!=
PyUnicode_1BYTE_KIND
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment