<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 1, 2015 at 2:10 PM, Alexander Cherepanov <span dir="ltr"><<a href="mailto:ch3root@openwall.com" target="_blank">ch3root@openwall.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2015-09-16 18:25, Mark Wielaard wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, 2015-09-11 at 12:22 -0700, Roland McGrath wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It looks fine to me from a quick skim, but Mark should review and test it too.<br>
</blockquote>
<br>
I am not super enthusiastic about this change, it seems to just take<br>
away type/size information that the compiler/bounds checking tools can<br>
use.<br>
</blockquote>
<br></span>
I'm not sure I fully understand the problem. As I understand it unions of VLAs are not Ok while VLAs are Ok and even desirable due to bounds checking, right?<br>
<br>
Why not just use VLAs of unions? Cold memory?<br></blockquote><div><br></div><div>I think this does not work because some part of elfutils walks through an array of T32 (or an array of T64), not an array of union of T32 and T64.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Given that the current approach (before the patch) already required to write superfluous "->" perhaps an approach requiring a superfluous "*" will fit? Like this:<span class=""><br>
<br>
void *data = malloc (...);<br></span>
T32 (*a32)[n] = data;<br>
T64 (*a64)[n] = data;<br>
<br>
Then the use looks like "(*a32)[i].member". Clang seems to be happy and its UBSAN works fine.</blockquote><div><br></div><div>This looks fine to me. I don't mind either way.</div><div>Anyone else prefers a32[i] or (*a32)[i]?</div><div><br></div><div>-- chh</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Alexander Cherepanov<br>
</font></span></blockquote></div><br></div></div>