<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta content="MSHTML 6.00.2900.6036" name="GENERATOR">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Hi Dan</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I thought one-past-the-end rule about overflow
</font><font face="tahoma" size="2">applies to one past element</font></div>
<div dir="ltr"><font face="tahoma" size="2">of array on c99 and it is same with </font>
<font face="tahoma" size="2">the rule of inbounds.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="Tahoma" size="2">Current code is so good implematation about the address immediately</font></div>
<div dir="ltr"><font face="Tahoma" size="2">after the end of the </font><font face="Tahoma" size="2">object.
</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Thanks,</font></div>
<div dir="ltr"><font face="tahoma" size="2">Jin-Gu Kang</font></div>
<div id="divRpF61690" style="DIRECTION: ltr"><font face="Tahoma" size="2">
<hr tabindex="-1">
</font><font face="Tahoma"><font size="2"><b>From:</b> Dan Gohman [gohman@apple.com]<br>
<b>Sent:</b> Friday, March 04, 2011 4:42 AM<br>
<b>To:</b> Jin Gu Kang<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm-commits] checking of inbounds for multi dimensional arrary and struct array on isInBoundsIndices()<br>
</font></font><br>
</div>
<div></div>
<div>On Mar 2, 2011, at 9:00 PM, Jin Gu Kang wrote: <br>
<blockquote type="cite">char a[3][2];<br>
struct test {<br>
  char a;<br>
  int b;<br>
};<br>
struct test foo[3];</blockquote>
[…]<br>
<blockquote type="cite">-------------------------------------------------------------------<br>
isInBoundsIndices() doesn't return inbounds flag as true on<br>
a[3][1] = 3,  a[3][2] = 4 and  foo[3].b = 7.<br>
</blockquote>
<div><br>
</div>
<div>That's the intended behavior. The one-past-the-end rule for inbounds</div>
<div>only applies to the address immediately after the end of the</div>
<div>object, which would be just &a[3][0] and &foo[3].a.</div>
<br>
<div>Dan</div>
<div><br>
</div>
</div>
</body>
</html>