llvm.org GIT mirror llvm / 339591e
Fix assertion when C++ EH filters are present in functions using SEH Should fix PR22305. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226969 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 5 years ago
2 changed file(s) with 23 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
220220
221221 // Do a parallel iteration across typeids and clause labels, skipping filter
222222 // clauses.
223 assert(LPad->TypeIds.size() == LPad->ClauseLabels.size());
223 size_t NextClauseLabel = 0;
224224 for (size_t I = 0, E = LPad->TypeIds.size(); I < E; ++I) {
225225 // AddLandingPadInfo stores the clauses in reverse, but there is a FIXME
226226 // to change that.
227227 int Selector = LPad->TypeIds[E - I - 1];
228 MCSymbol *ClauseLabel = LPad->ClauseLabels[I];
229228
230229 // Ignore C++ filter clauses in SEH.
231230 // FIXME: Implement cleanup clauses.
242241 else // Otherwise, this is a "catch i8* null", or catch all.
243242 Asm->OutStreamer.EmitIntValue(1, 4);
244243 }
244 MCSymbol *ClauseLabel = LPad->ClauseLabels[NextClauseLabel++];
245245 Asm->OutStreamer.EmitValue(createImageRel32(ClauseLabel), 4);
246246 }
247247 }
0 ; RUN: llc -O0 -mtriple=x86_64-windows-msvc < %s | FileCheck %s
1
2 declare void @g()
3 define void @f() {
4 invoke void @g() to label %return unwind label %lpad
5
6 return:
7 ret void
8
9 lpad:
10 %ehptrs = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
11 filter [0 x i8*] zeroinitializer
12 call void @__cxa_call_unexpected(i8* null)
13 unreachable
14 }
15 declare i32 @__C_specific_handler(...)
16 declare void @__cxa_call_unexpected(i8*)
17
18 ; We don't emit entries for filters.
19 ; CHECK: .seh_handlerdata
20 ; CHECK: .long 0