diff gen/llvmhelpers.cpp @ 304:3ebc136702dd trunk

[svn r325] Removed dead code. Added license info to code from GDC (David Friedman permitted us to use the files under the Artistic License). Added asmLabel check to DtoGoto to avoid jumping into inline asm. Doesn't work currently as LabelDsymbol::asmLabel is never set to true.
author ChristianK
date Wed, 25 Jun 2008 23:42:38 +0200
parents bef811104734
children 2b72433d5c8c
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Wed Jun 25 20:42:30 2008 +0200
+++ b/gen/llvmhelpers.cpp	Wed Jun 25 23:42:38 2008 +0200
@@ -158,6 +158,10 @@
 {
     assert(!gIR->scopereturned());
 
+    // if the target label is inside inline asm, error
+    if(target->asmLabel)
+        error("cannot goto into inline asm block", loc->toChars());
+
     if (target->statement->llvmBB == NULL)
         target->statement->llvmBB = llvm::BasicBlock::Create("label", gIR->topfunc());