<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>In r6346.</div><div><br></div><div>Thanks,</div><div>Manman</div><br><div><div>On Jul 18, 2013, at 9:17 AM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">lgtm.<br><br>-Chris<br><br>On Jul 17, 2013, at 5:47 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br><br><blockquote type="cite"><br>The testing case has a global variable defined in .sil: "var x: Int = 0"<br>When parsing the .sil file, I got an assertion failure where the type of a ValueDecl is null.<br><br>To fix the problem, the patch modified lib/Sema/TypeCheckDecl.cpp:<br>@@ -316,6 +316,7 @@<br> void visitPatternBindingDecl(PatternBindingDecl *PBD) {<br>   bool DelayCheckingPattern =<br>     TC.TU.Kind != TranslationUnit::Library &&<br>+      TC.TU.Kind != TranslationUnit::SIL &&<br>     PBD->getDeclContext()->isModuleContext();<br>   if (IsSecondPass && !DelayCheckingPattern) {<br>     if (PBD->getInit() && PBD->getPattern()->hasType()) {<br><br>Inside SILParser, a module level lookup is used to find the VarDecl for the global variable.<br><br>Thanks for reviewing,<br>Manman<br><global_addr.patch></blockquote></div></blockquote></div><br></body></html>