<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 19, 2013, at 1:05 PM, Mark Seaborn <<a href="mailto:mseaborn@chromium.org">mseaborn@chromium.org</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 19 June 2013 13:01, Mark Seaborn <span dir="ltr"><<a href="mailto:mseaborn@chromium.org" target="_blank">mseaborn@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Use ARM-style representation for C++ method pointers under PNaCl<br><br>Before this change, Clang uses the x86 representation for C++ method<br>
pointers when generating code for PNaCl. However, the resulting code<br>
will assume that function pointers are 0 mod 2. This assumption is<br>not safe for PNaCl, where function pointers could have any value<br>(especially in future sandboxing models).<br><br>So, switch to using the ARM representation for PNaCl code, which makes<br>
no assumptions about the alignment of function pointers.<br><br>See: <a href="https://code.google.com/p/nativeclient/issues/detail?id=3450" target="_blank">https://code.google.com/p/nativeclient/issues/detail?id=3450</a><br>
</div></blockquote><div><br></div><div>Oops, I meant to send this to cfe-commits rather than llvm-commits.<br></div></div></div></div></blockquote></div><br><div>I do not think you should just unconditionally opt in to random ARM</div><div>behavior. In particular, ARM uses 32-bit guard variables because that's</div><div>the size of a pointer on ARM; PNaCl needs to be able to efficiently</div><div>support 64-bit platforms as well.</div><div><br></div><div>Anyway, at the very least you should have your own subclass and</div><div>abstract out the behavior properly instead of setting an "IsARM" flag.</div><div>It's understood that the IsARM flag is not a good abstraction; we've</div><div>just been avoiding abstracting it further because you can't really</div><div>generalize from two data points.</div><div><br></div><div>John.</div></body></html>