[cfe-dev] RFC on array-bounds patch

Daniel Marjamäki Daniel.Marjamaki at evidente.se
Wed Feb 19 11:00:59 PST 2014


Hello!

> I see the diagnostic without any patches. Are you sure you were testing the existing code with alpha.security.ArrayBound on? Is there a more complex example that wasn't working?

I fail to reproduce right now. The warning is reported.

I'll investigate if I can reproduce the false negative again.

Thanks!
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki<mailto:Daniel.Marjamaki at evidente.se>@evidente.se<mailto:Daniel.Marjamaki at evidente.se>

www.evidente.se
________________________________
Från: Jordan Rose [jordan_rose at apple.com]
Skickat: den 18 februari 2014 18:08
Till: Daniel Marjamäki
Cc: cfe-dev at cs.uiuc.edu
Ämne: Re: [cfe-dev] RFC on array-bounds patch

I see the diagnostic without any patches. Are you sure you were testing the existing code with alpha.security.ArrayBound on? Is there a more complex example that wasn't working?

Background: checkLocation is supposed to be called on both loads and stores already, which is why it has the "isLoad" argument.

Jordan


On Feb 17, 2014, at 10:29 , Daniel Marjamäki <Daniel.Marjamaki at evidente.se<mailto:Daniel.Marjamaki at evidente.se>> wrote:

Hello!

Here is a patch that will make Clang warn when there is this index out of bounds:

    void f(int x) {
        int a[10];
        if (x >= 10)
            a[x] = x;
    }

The checkLocation is not triggered on the "a[x] = x;" statement. Is this by design? Is the checkPrestmt a good choice or would it be better to choose some other check type?

Best regards,
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden



Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki<mailto:Daniel.Marjamaki at evidente.se>@evidente.se<mailto:Daniel.Marjamaki at evidente.se>



www.evidente.se<http://www.evidente.se/>
_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140219/50480c47/attachment.html>


More information about the cfe-dev mailing list