<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
TD {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
LI {
        MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt
}
BODY {
        LINE-HEIGHT: 1.4; MARGIN: 10px; FONT-FAMILY: Arial, arial; FONT-SIZE: 9pt
}
</STYLE>

<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY>
<P>This is the similar way it has been fixed in gcc. They have kept a note of parent and they break the loop when it is again noticed. With the usage of global</P>
<P>map there are no performance issues as such. Also please suggest the alternate way of fixing this issue.</P>
<P>Thanks,</P>
<P>Mayur</P>
<P> </P>
<P>------- <B>Original Message</B> -------</P>
<P><B>Sender</B> : Eli Friedman<eli.friedman@gmail.com></P>
<P><B>Date</B> : Sep 10, 2013 06:53 (GMT+09:00)</P>
<P><B>Title</B> : Re: Fix for ICE in clang due to infinite loop.</P>
<P> </P>
<DIV dir=ltr>
<DIV>On Mon, Sep 9, 2013 at 5:08 AM, MAYUR PANDEY <SPAN dir=ltr><<A href="mailto:mayur.p@samsung.com" target=_blank>mayur.p@samsung.com</A>></SPAN> wrote:<BR></DIV>
<DIV class=gmail_extra>
<DIV class=gmail_quote>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>
<DIV>
<P><SPAN style="FONT-FAMILY: Arial">Hi,</SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">Attached is the fix for Compiler crash caused by infinite loop when we try to compile the following code.</SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial"></SPAN> </P>
<P><SPAN style="FONT-FAMILY: Arial">struct A;</SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">struct B<BR>{<BR>  B (A const &); </SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">  B (B &); <BR>};</SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">struct A<BR>{<BR>  A (B);<BR>};</SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">B<BR>f (B const& b)<BR>{<BR>  return b; </SPAN></P>
<P><SPAN style="FONT-FAMILY: Arial">}</SPAN></P></DIV></BLOCKQUOTE>
<DIV>The patch is missing a testcase.  Patches should generally include a corresponding change to clang/test/.  (In this case, somewhere in clang/test/SemaCXX/ is probably appropriate.) <BR></DIV>
<DIV><BR></DIV>
<DIV>This is not the right approach to fixing this issue.  One, we're supposed to detect issues like this inside the InitializationSequence constructor, when we actually check the initialization.  Not handling this correctly will break overload resolution.  Second, using a global map like this is rather suspect: I'm not sure it will cause issues, but introducing global state for something like this makes it more difficult to understand the code.</DIV>
<DIV><BR></DIV>
<DIV>My guess is that the right fix is somewhere in SemaOverload.cpp: we're probably mishandling this case in the user-defined conversion code somewhere.</DIV>
<DIV><BR></DIV></DIV>-Eli</DIV></DIV>
<P> </P>
<P> </P><!--SP:mayur.p--><!--mayur.p:EP-->
<P> </P>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:QKNMBDIFBEI0@namo.co.kr" width=520></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=4284d65aa8566a3cc4b2b7c9d6f9bd0a5f5dde03fbefdfc2e9a2b094e88a4f1f81a5d6148418374b434c6ebf74e200ff220d3e02ce1cb961d6250c6ef56fc7aacf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>