Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-26 Thread Michael Hudson
"Neal Norwitz" <[EMAIL PROTECTED]> writes: > On 7/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> > >> > Yes, I definitely think dropping the X would make the warning go away. >> > Do we want to check for a NULL pointer and raise an exception? The >> > docs don't address the issue, so I th

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-26 Thread Gerhard Häring
Martin v. Löwis wrote: > Neal Norwitz wrote: >> # 61 Modules/_sqlite/cursor.c:599 Null pointer may be dereferenced >> >> Null pointer 'self->statement' that comes from line 674 may be >> dereferenced by passing argument 1 to function >> 'statement_mark_dirty' at line 599. > > Looks li

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-26 Thread Georg Brandl
Neal Norwitz wrote: > On 7/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Neal Norwitz wrote: >> > # 74 Object/funcobject.c:143Suspicious deref of ptr before NULL check >> >> Not quite sure what it is complaining about, but >> >> else if (PyTuple_Check(closure)) { >>

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Neal Norwitz
On 7/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > We never really did address this issue did? A while back we talked > > about whether to assert vs check and do PyErr_BadInternalCall(). I > > don't remember a clear resolution (though my memory). I vaguely > > rem

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Martin v. Löwis
Neal Norwitz wrote: > We never really did address this issue did? A while back we talked > about whether to assert vs check and do PyErr_BadInternalCall(). I > don't remember a clear resolution (though my memory). I vaguely > remember a preference towards asserting, but I don't know if that was

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Neal Norwitz
On 7/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > Yes, I definitely think dropping the X would make the warning go away. > > Do we want to check for a NULL pointer and raise an exception? The > > docs don't address the issue, so I think if we added a check, ie: if > > (closure && P

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Martin v. Löwis
Neal Norwitz wrote: >> Not quite sure what it is complaining about, but >> >> else if (PyTuple_Check(closure)) { >> Py_XINCREF(closure); >> } >> >> looks indeed suspicious: Why do we check for NULL (XINCREF) when >> we know closure can't be NULL (Tuple_Check). Drop t

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Neal Norwitz
On 7/25/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote: > > Neal Norwitz wrote: > >> # 74 Object/funcobject.c:143Suspicious deref of ptr before NULL check > > > > Not quite sure what it is complaining about, but > > > > else if (PyTuple_Check(closure)) { > >

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Neal Norwitz
On 7/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > # 74 Object/funcobject.c:143Suspicious deref of ptr before NULL check > > Not quite sure what it is complaining about, but > > else if (PyTuple_Check(closure)) { > Py_XINCREF(closure); >

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Georg Brandl
Martin v. Löwis wrote: > Neal Norwitz wrote: >> # 74 Object/funcobject.c:143Suspicious deref of ptr before NULL check > > Not quite sure what it is complaining about, but > > else if (PyTuple_Check(closure)) { > Py_XINCREF(closure); > } > > looks indeed suspic

Re: [Python-Dev] remaining issues from Klocwork static analysis

2006-07-25 Thread Martin v. Löwis
Neal Norwitz wrote: > # 74 Object/funcobject.c:143Suspicious deref of ptr before NULL check Not quite sure what it is complaining about, but else if (PyTuple_Check(closure)) { Py_XINCREF(closure); } looks indeed suspicious: Why do we check for NULL (XINCREF) w