diff options
author | Victor Stinner <vstinner@python.org> | 2024-06-07 15:58:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 15:58:21 (GMT) |
commit | 90b75405260467814c93738a3325645918d4ea51 (patch) | |
tree | 6e2da8fd5fa2edc345a04635a5c035e4a61dae37 /Python/optimizer.c | |
parent | a7584245661102a5768c643fbd7db8395fd3c90e (diff) | |
download | cpython-90b75405260467814c93738a3325645918d4ea51.zip cpython-90b75405260467814c93738a3325645918d4ea51.tar.gz cpython-90b75405260467814c93738a3325645918d4ea51.tar.bz2 |
gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (#120228)
Don't hardcode 'dest' in HAVE_SUBOFFSETS_IN_LAST_DIM() macro of
memoryobject.c, but use its 'view' parameter instead.
Fix the Coverity issue:
Error: COPY_PASTE_ERROR (CWE-398):
Python-3.12.2/Objects/memoryobject.c:273:14: original: ""dest->suboffsets + (dest->ndim - 1)"" looks like the original copy.
Python-3.12.2/Objects/memoryobject.c:274:14: copy_paste_error: ""dest"" in ""src->suboffsets + (dest->ndim - 1)"" looks like a copy-paste error.
Python-3.12.2/Objects/memoryobject.c:274:14: remediation: Should it say ""src"" instead?
# 272| assert(dest->ndim > 0 && src->ndim > 0);
# 273| return (!HAVE_SUBOFFSETS_IN_LAST_DIM(dest) &&
# 274|-> !HAVE_SUBOFFSETS_IN_LAST_DIM(src) &&
# 275| dest->strides[dest->ndim-1] == dest->itemsize &&
# 276| src->strides[src->ndim-1] == src->itemsize);
Diffstat (limited to 'Python/optimizer.c')
0 files changed, 0 insertions, 0 deletions