<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 12/15/13 8:22 PM, 李永超 wrote:<br>
    </div>
    <blockquote
cite="mid:CALz-__dPL33w_RaB--i+mmXDsmQ8za++OXcC0YyNFnBPYqsTTw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div>How can I obtain the upper bound of a pointer in the code?
          For example, I have </div>
        <div>a pointer Ptr which points to a block of memory that is
          allocated by malloc, say,</div>
        <div><br>
        </div>
        <div>Ptr = malloc(size);</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Then what should I do if I am going to get the upper bound
          of the memory block</div>
        <div>that is pointed to by Ptr in the runtime?</div>
      </div>
    </blockquote>
    <br>
    Both SAFECode (<a class="moz-txt-link-freetext" href="http://safecode.cs.illinois.edu">http://safecode.cs.illinois.edu</a>) and SoftBound
    (<a class="moz-txt-link-freetext" href="http://acg.cis.upenn.edu/softbound">http://acg.cis.upenn.edu/softbound</a>) 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.<br>
    <br>
    -- John T.<br>
    <br>
    <blockquote
cite="mid:CALz-__dPL33w_RaB--i+mmXDsmQ8za++OXcC0YyNFnBPYqsTTw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Ben</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>