<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Windows] evaluating a variable from an outer scope in a @finally inside a block causes an internal compiler error"
href="https://bugs.llvm.org/show_bug.cgi?id=44483">44483</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Windows] evaluating a variable from an outer scope in a @finally inside a block causes an internal compiler error
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>duhowett@microsoft.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22996" name="attach_22996" title="preprocessed repro">attachment 22996</a> <a href="attachment.cgi?id=22996&action=edit" title="preprocessed repro">[details]</a></span>
preprocessed repro
With the following source:
```
// clang -emit-llvm -S -fblocks --target=i686-pc-windows-msvc repro.mm
int test() {
int outer;
auto b = ^() {
@try {
} @finally {
outer;
}
};
}
```
the compiler fails with the following stack dump.
```
Stack dump:
0. Program arguments: C:\Program Files\LLVM\bin\clang.exe -cc1 -triple
i686-pc-windows-msvc19.11.0 -emit-llvm -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name repro.mm -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -target-cpu pentium4 -dwarf-column-info
-coverage-notes-file E:\repro.gcno -resource-dir C:\Program
Files\LLVM\lib\clang\9.0.0 -internal-isystem C:\Program
Files\LLVM\lib\clang\9.0.0\include -internal-isystem C:\Program Files
(x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\include
-internal-isystem C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
-internal-isystem C:\Program Files (x86)\Windows
Kits\10\include\10.0.18362.0\ucrt -internal-isystem C:\Program Files
(x86)\Windows Kits\10\include\10.0.18362.0\shared -internal-isystem C:\Program
Files (x86)\Windows Kits\10\include\10.0.18362.0\um -internal-isystem
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
-internal-isystem C:\Program Files (x86)\Windows
Kits\10\include\10.0.18362.0\cppwinrt -fdeprecated-macro
-fdebug-compilation-dir E:\ -ferror-limit 19 -fmessage-length 158 -fblocks
-fno-use-cxa-atexit -fms-extensions -fms-compatibility
-fms-compatibility-version=19.11 -std=c++14 -fdelayed-template-parsing
-fobjc-runtime=gcc -fobjc-exceptions -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o repro.ll -x
objective-c++ repro.mm
1. <eof> parser at end of file
2. repro.mm:1:5: LLVM IR generation of declaration 'test'
3. repro.mm:1:5: Generating code for declaration 'test'
4. repro.mm:3:18: LLVM IR generation of compound statement ('{}')
#0 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x19d349a C:\Program
Files\LLVM\bin\clang.exe 0x19d4903
#1 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a6eccc C:\Program
Files\LLVM\bin\clang.exe 0x18d0c3a
#2 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a710c4 C:\Program
Files\LLVM\bin\clang.exe 0x1a79dc0
#3 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a7956b C:\Program
Files\LLVM\bin\clang.exe 0x1a71626
#4 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a70b1f C:\Program
Files\LLVM\bin\clang.exe 0x1a9ef99
#5 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a9bf22 C:\Program
Files\LLVM\bin\clang.exe 0x1a9a6bc
#6 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1acdf90 C:\Program
Files\LLVM\bin\clang.exe 0x1ac390e
#7 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a0ffdf C:\Program
Files\LLVM\bin\clang.exe 0x1a14ebe
#8 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a12948 C:\Program
Files\LLVM\bin\clang.exe 0x1a0e3d6
#9 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a0e063 C:\Program
Files\LLVM\bin\clang.exe 0x1a7966c
#10 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a716b9 C:\Program
Files\LLVM\bin\clang.exe 0x1a70b1f
#11 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1a79dc0 C:\Program
Files\LLVM\bin\clang.exe 0x1995cae
#12 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1996599 C:\Program
Files\LLVM\bin\clang.exe 0x181cb1d
#13 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x181618c C:\Program
Files\LLVM\bin\clang.exe 0x1819d61
#14 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x181f55d C:\Program
Files\LLVM\bin\clang.exe 0x33cbc3f
#15 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x33c9719 C:\Program
Files\LLVM\bin\clang.exe 0x275b465
#16 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1cb3492 C:\Program
Files\LLVM\bin\clang.exe 0x1c771cf
#17 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x1d09c87 C:\Program
Files\LLVM\bin\clang.exe 0x6e87
#18 0x00007ff64b3e349a C:\Program Files\LLVM\bin\clang.exe 0x4564 C:\Program
Files\LLVM\bin\clang.exe 0x33dda20
```</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>