[LLVMdev] How can I obtain upper bound of a pointer?

John Criswell criswell at illinois.edu
Mon Dec 16 08:13:58 PST 2013


On 12/15/13 8:22 PM, 李永超 wrote:
> Hi,
> How can I obtain the upper bound of a pointer in the code? For 
> example, I have
> a pointer Ptr which points to a block of memory that is allocated by 
> malloc, say,
>
> Ptr = malloc(size);
>
>
> Then what should I do if I am going to get the upper bound of the 
> memory block
> that is pointed to by Ptr in the runtime?

Both SAFECode (http://safecode.cs.illinois.edu) and SoftBound 
(http://acg.cis.upenn.edu/softbound) have run-time support for finding 
the bounds of an object given a pointer into the object. SAFECode and 
SoftBound are combined into a single tool available in the SAFECode 
source code repository (see the SAFECode website for directions on how 
to download and compile the software).  You can play with both of them 
and see which will suite your needs better.

-- John T.

>
> Thanks,
> Ben
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131216/5892d40c/attachment.html>


More information about the llvm-dev mailing list