diff options
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 20ea349..57e6cd5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1787,11 +1787,23 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) break; case BUILD_MAP: - x = PyDict_New(); + x = _PyDict_NewPresized((Py_ssize_t)oparg); PUSH(x); if (x != NULL) continue; break; + case STORE_MAP: + w = TOP(); /* key */ + u = SECOND(); /* value */ + v = THIRD(); /* dict */ + STACKADJ(-2); + assert (PyDict_CheckExact(v)); + err = PyDict_SetItem(v, w, u); /* v[w] = u */ + Py_DECREF(u); + Py_DECREF(w); + if (err == 0) continue; + break; + case LOAD_ATTR: w = GETITEM(names, oparg); v = TOP(); |