On Oct 25, 2007, at 4:35 PM, Paul Cochrane (via RT) wrote:

# New Ticket Created by  Paul Cochrane
# Please include the string:  [perl #46927]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=46927 >


The attached patch removes a compiler warning about comparing an
integer to a pointer.  Given the well commented code it was easy to
work out another way to write the code with the same meaning as that
given in the comment.  However, since I'm not 100% sure that I got
everything right (make test passed btw) I thought I'd post this to the
list.

Comments most certainly welcome!  If no complaints turn up, I'll
commit this in about three days.

Paul
<slice_pmc.patch>

Given that it's possible for r to be -1, see line 189, I believe this patch may still have the issue of dereferencing before it being valid. Maybe the test coverage isn't full enough or maybe that part of the code is outdated, but it looks like r can still become -1 which would cause problems. The simplest way to do it is something like (INTVAL)r != (INTVAL)-1. It makes the assumption(the docs used to guarantee this but I don't believe so anymore) that you can convert a pointer to INTVAL and back and keep all the data.

Reply via email to