diff options
author | Armin Rigo <arigo@tunes.org> | 2004-03-20 21:10:27 (GMT) |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2004-03-20 21:10:27 (GMT) |
commit | 75be012cbae9061e320616e1eeb960331b61d565 (patch) | |
tree | bfaaf3650d3b9fa6df83363b43d4458244b2a842 /Objects | |
parent | 497331fa2ba93ee290144046754c59b3025b5eb1 (diff) | |
download | cpython-75be012cbae9061e320616e1eeb960331b61d565.zip cpython-75be012cbae9061e320616e1eeb960331b61d565.tar.gz cpython-75be012cbae9061e320616e1eeb960331b61d565.tar.bz2 |
memset() with small memory sizes just kill us.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 1dfded7..81b3819 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -540,7 +540,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, PyFrameObject *back = tstate->frame; PyFrameObject *f; PyObject *builtins; - int extras, ncells, nfrees; + int extras, ncells, nfrees, i; #ifdef Py_DEBUG if (code == NULL || globals == NULL || !PyDict_Check(globals) || @@ -641,7 +641,9 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, f->f_nfreevars = nfrees; extras = f->f_nlocals + ncells + nfrees; - memset(f->f_localsplus, 0, extras * sizeof(f->f_localsplus[0])); + /* Tim said it's ok to replace memset */ + for (i=0; i<extras; i++) + f->f_localsplus[i] = NULL; f->f_valuestack = f->f_localsplus + extras; f->f_stacktop = f->f_valuestack; |