<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2016, at 8:38 AM, Paul <<a href="mailto:paul@sec.in.tum.de" class="">paul@sec.in.tum.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
Hi Mehdi,<br class="">
<br class="">
thanks a lot for your email. Actually I was disappointed by the fact
that I was not able to get a useful answer to my two questions.<br class="">
As I observed that the questions move down along the list with time
passing I decided to re-post them in the hope that the questions <br class="">
will have a better visibility.<br class=""></div></div></blockquote><div><br class=""></div><div>I don’t think we have a guideline on this, but reposting more than once a week seems too much.</div><br class=""><blockquote type="cite" class=""><div class=""><div bgcolor="#FFFFFF" text="#000000" class="">
Could you help me with the two questions? Finding an expert in this
area would be of great help. Do you think the questions are not well
stated.<br class=""></div></div></blockquote><div><br class=""></div><div>As mentioned in my previous email, you got two answers to your previous questions that went apparently ignored. A good starting point would be to iterate from there. Reposting the same question means that someone may spend time answering the same thing as the answer you already got because your repost does not maintain the threading / history of the discussion.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div bgcolor="#FFFFFF" text="#000000" class="">
<br class="">
Regards<br class="">
Paul<br class="">
<br class="">
<div class="moz-cite-prefix">On 12/21/2016 05:31 PM, Mehdi Amini
wrote:<br class="">
</div>
<blockquote cite="mid:49A27405-F2CC-46A6-996E-F259F535BA3F@apple.com" type="cite" class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">Hi
Paul,</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">It is
the 4th time in two weeks that you repost the exact same two
emails, that’s a bit high repost rate for the mailing-list,
especially considering that you already got answers that you
ignored previously:</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">- <a moz-do-not-send="true" href="http://lists.llvm.org/pipermail/llvm-dev/2016-December/108060.html" class=""></a><a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/llvm-dev/2016-December/108060.html">http://lists.llvm.org/pipermail/llvm-dev/2016-December/108060.html</a></div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">- <a moz-do-not-send="true" href="http://lists.llvm.org/pipermail/llvm-dev/2016-December/108051.html" class=""></a><a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/llvm-dev/2016-December/108051.html">http://lists.llvm.org/pipermail/llvm-dev/2016-December/108051.html</a></div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">Adding
an alternate email in case you didn’t receive previous emails.</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">
<table class="vtop" style="border-collapse: collapse; border-spacing: 0px; padding: 0px; margin: 0px; border: none; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px;">
<tbody class="">
<tr class="">
<td style="margin: 0px; padding: 10px 1ex 0px 0px;
text-align: justify; vertical-align: top;" class="">Best,</td>
</tr>
</tbody>
</table>
<div class=""><br class="">
</div>
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">— </div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">Mehdi</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
</div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Dec 21, 2016, at 2:47 AM, Paul Muntean
via llvm-dev <<a moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">I want to detect bad casts in C++ code by
using the Clang<br class="">
compiler. The approach is similar to what Caver and
TypeSan do but<br class="">
without using the compiler-rt.<br class="">
<br class="">
Caver and TypeSan:<br class="">
<a moz-do-not-send="true" href="https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-lee.pdf" class="">https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-lee.pdf</a><br class="">
<a class="moz-txt-link-freetext" href="https://nebelwelt.net/publications/files/16CCS2.pdf">https://nebelwelt.net/publications/files/16CCS2.pdf</a><br class="">
<br class="">
For example if I have the following C++ code snippet
where I want to<br class="">
cast object b into<br class="">
object D.<br class="">
<br class="">
D* obj = static_cast<D*>(b);<br class="">
<br class="">
from where (inside Clang, LTO, thinLTO, etc.) can I
get the base class<br class="">
of D and the base class ob b. Is this<br class="">
available in the Clang compiler or LTO?<br class="">
</div>
</div>
</blockquote>
<blockquote type="cite" class="">
<div class="">
<div class=""><br class="">
Also, if b is an object of a virtual Class (class with
inherited or its<br class="">
own virtual functions) can I get its virtual pointer
at compile time<br class="">
by using the LTO?<br class="">
<br class="">
I found out that in CodeGen/CGExpr.cpp the explicit
case "BaseToDerived" is<br class="">
handled and you can retrieve TypeSourceInfo using the
function<br class="">
getTypeInfoAsWritten(). It seems that this information
is enough to get<br class="">
the exact type of this cast at compile-time and should
also work for<br class="">
Template programming, as my, understanding is that
Clang should have<br class="">
abstracted the code into, specific types at this
point.<br class="">
<br class="">
Am I wrong here?<br class="">
<br class="">
Is there any case where the type of the objects used
inside the cast<br class="">
not known at compile time? Can the,<br class="">
'real' type be hidden behind a pointer?<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
<br class="">
<pre class="moz-signature" cols="72">--
Paul Muntean
Lehrstuhl für Sicherheit in der Informatik, I20
Prof. Dr. Claudia Eckert
Institut für Informatik TU-München
Boltzmannstr. 3, 85748 Garching, Germany
Tel.: ++49 (89) 289 - 18566
Fax : ++49 (89) 289 - 18579
Room: 01.08.055
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:paul@sec.in.tum.de">paul@sec.in.tum.de</a>
<a class="moz-txt-link-freetext" href="https://www.sec.in.tum.de/">https://www.sec.in.tum.de</a></pre>
</div>
</div></blockquote></div><br class=""></body></html>