mirror of
https://github.com/python/cpython.git
synced 2025-07-14 23:05:17 +00:00
upcast int to size_t to silence two autological-constant-out-of-range-compare warnings with clang.
This commit is contained in:
parent
7a934fb48d
commit
724b828e79
2 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ PyNode_AddChild(node *n1, int type, char *str, int lineno, int col_offset)
|
||||||
if (current_capacity < 0 || required_capacity < 0)
|
if (current_capacity < 0 || required_capacity < 0)
|
||||||
return E_OVERFLOW;
|
return E_OVERFLOW;
|
||||||
if (current_capacity < required_capacity) {
|
if (current_capacity < required_capacity) {
|
||||||
if (required_capacity > PY_SIZE_MAX / sizeof(node)) {
|
if ((size_t)required_capacity > PY_SIZE_MAX / sizeof(node)) {
|
||||||
return E_NOMEM;
|
return E_NOMEM;
|
||||||
}
|
}
|
||||||
n = n1->n_child;
|
n = n1->n_child;
|
||||||
|
|
|
@ -3899,7 +3899,7 @@ assemble_init(struct assembler *a, int nblocks, int firstlineno)
|
||||||
a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE);
|
a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE);
|
||||||
if (!a->a_lnotab)
|
if (!a->a_lnotab)
|
||||||
return 0;
|
return 0;
|
||||||
if (nblocks > PY_SIZE_MAX / sizeof(basicblock *)) {
|
if ((size_t)nblocks > PY_SIZE_MAX / sizeof(basicblock *)) {
|
||||||
PyErr_NoMemory();
|
PyErr_NoMemory();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue