Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 1160:7d28dcbff23e
Reenable error for gotos into or out of finally blocks.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 28 Mar 2009 19:16:53 +0100 |
parents | 3cf0066e6faf |
children | ed4b050ada45 |
comparison
equal
deleted
inserted
replaced
1159:c6d6a68bb5db | 1160:7d28dcbff23e |
---|---|
170 | 170 |
171 /****************************************************************************************/ | 171 /****************************************************************************************/ |
172 /*//////////////////////////////////////////////////////////////////////////////////////// | 172 /*//////////////////////////////////////////////////////////////////////////////////////// |
173 // GOTO HELPER | 173 // GOTO HELPER |
174 ////////////////////////////////////////////////////////////////////////////////////////*/ | 174 ////////////////////////////////////////////////////////////////////////////////////////*/ |
175 void DtoGoto(Loc loc, Identifier* target) | 175 void DtoGoto(Loc loc, Identifier* target, TryFinallyStatement* sourceFinally) |
176 { | 176 { |
177 assert(!gIR->scopereturned()); | 177 assert(!gIR->scopereturned()); |
178 | 178 |
179 LabelStatement* lblstmt = DtoLabelStatement(target); | 179 LabelStatement* lblstmt = DtoLabelStatement(target); |
180 if(!lblstmt) { | 180 if(!lblstmt) { |
197 // emit code for finallys between goto and label | 197 // emit code for finallys between goto and label |
198 DtoEnclosingHandlers(loc, lblstmt); | 198 DtoEnclosingHandlers(loc, lblstmt); |
199 | 199 |
200 // goto into finally blocks is forbidden by the spec | 200 // goto into finally blocks is forbidden by the spec |
201 // but should work fine | 201 // but should work fine |
202 /* | 202 if(lblstmt->enclosingFinally != sourceFinally) { |
203 if(lblstmt->tf != sourcetf) { | 203 error(loc, "spec disallows goto into or out of finally block"); |
204 error(loc, "spec disallows goto into finally block"); | |
205 fatal(); | 204 fatal(); |
206 }*/ | 205 } |
207 | 206 |
208 llvm::BranchInst::Create(targetBB, gIR->scopebb()); | 207 llvm::BranchInst::Create(targetBB, gIR->scopebb()); |
209 } | 208 } |
210 | 209 |
211 /****************************************************************************************/ | 210 /****************************************************************************************/ |