classification
Title: swapped arguments in compatible_for_assignment()?
Type: behavior Stage: test needed
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, christian.heimes, python-dev
Priority: normal Keywords:

Created on 2013-06-29 19:08 by christian.heimes, last changed 2013-07-20 12:20 by christian.heimes. This issue is now closed.

Messages (3)
msg192042 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-06-29 19:08
Coverity has found something fishy in our code base:

CID 983564 (#1 of 1): Arguments in wrong order (SWAPPED_ARGUMENTS)swapped_arguments: The positions of arguments newto and oldto are inconsistent with the positions of the corresponding parameters for "compatible_for_assignment(PyTypeObject *, PyTypeObject *, char *)".

Object/typeobject.c:3326
    if (compatible_for_assignment(newto, oldto, "__class__")) {
Objects/typeobject.c.3265

static int
compatible_for_assignment(PyTypeObject* oldto, PyTypeObject* newto, char* attr)
msg192144 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2013-07-01 17:53
Fortunately, compatible_for_assignment() handles both arguments exactly the same way, except maybe in error messages.
msg193405 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-20 12:19
New changeset a65856044ad4 by Christian Heimes in branch 'default':
Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto, attr).
http://hg.python.org/cpython/rev/a65856044ad4
History
Date User Action Args
2013-07-20 12:20:36christian.heimessetstatus: open -> closed
resolution: fixed
2013-07-20 12:19:56python-devsetnosy: + python-dev
messages: + msg193405
2013-07-01 17:53:28amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg192144
2013-06-29 19:08:45christian.heimescreate