mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
gh-145866: Convert DICT_MERGE to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146329)
This commit is contained in:
parent
07a555d4fc
commit
6d73bc2267
10 changed files with 1236 additions and 1199 deletions
|
|
@ -2324,7 +2324,7 @@ dummy_func(
|
|||
PyStackRef_CLOSE(update);
|
||||
}
|
||||
|
||||
inst(DICT_MERGE, (callable, unused, unused, dict, unused[oparg - 1], update -- callable, unused, unused, dict, unused[oparg - 1])) {
|
||||
op(_DICT_MERGE, (callable, unused, unused, dict, unused[oparg - 1], update -- callable, unused, unused, dict, unused[oparg - 1], u)) {
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
PyObject *dict_o = PyStackRef_AsPyObjectBorrow(dict);
|
||||
PyObject *update_o = PyStackRef_AsPyObjectBorrow(update);
|
||||
|
|
@ -2332,12 +2332,14 @@ dummy_func(
|
|||
int err = _PyDict_MergeEx(dict_o, update_o, 2);
|
||||
if (err < 0) {
|
||||
_PyEval_FormatKwargsError(tstate, callable_o, update_o);
|
||||
PyStackRef_CLOSE(update);
|
||||
ERROR_IF(true);
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
PyStackRef_CLOSE(update);
|
||||
u = update;
|
||||
DEAD(update);
|
||||
}
|
||||
|
||||
macro(DICT_MERGE) = _DICT_MERGE + POP_TOP;
|
||||
|
||||
inst(MAP_ADD, (dict_st, unused[oparg - 1], key, value -- dict_st, unused[oparg - 1])) {
|
||||
PyObject *dict = PyStackRef_AsPyObjectBorrow(dict_st);
|
||||
assert(PyDict_CheckExact(dict));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue