[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-10-22 Thread Łukasz Langa
Change by Łukasz Langa : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-31 Thread Eric Lippert
Eric Lippert added the comment: If it were possible that the interpreter iterating over a dictionary could cause the dictionary to change size then I suspect that this would be a rich source of bugs to mine. :-) It would be great if we could make it a documented, enforced invariant that the

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-31 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-31 Thread STINNER Victor
STINNER Victor added the comment: > I think it is technically not possible. Neither PyDict_Next() nor Py_INCREF() > mutate the dict, call the user code or release GIL. If it could be possible, > we would have a potential writing out of a buffer here. When I read PyDict_Next(), I'm thinking a

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is technically not possible. Neither PyDict_Next() nor Py_INCREF() mutate the dict, call the user code or release GIL. If it could be possible, we would have a potential writing out of a buffer here. -- _

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-31 Thread STINNER Victor
STINNER Victor added the comment: Technically it's possible that the dictionary mutates itself during iterating and so that it's size change, so "nk = i / 2;" make sure that we pass the proper length to the function call. Maybe I'm wrong, but we would need an unit test for that. While I rew

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> vstinner nosy: +serhiy.storchaka, vstinner ___ Python tracker ___ ___ Python-bugs-lis

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Eric Lippert
Change by Eric Lippert : -- keywords: +patch pull_requests: +8479 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-lis

[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Eric Lippert
New submission from Eric Lippert : In _PyFunction_FastCallDict we have local nk assigned to be the size of a dictionary, and then local i is assigned to twice the size of the same dictionary, and then nk is assigned to half of i, which it already is: nk = (kwargs != NULL) ? PyDict_GET_SIZE