Index: llvm/trunk/lib/Transforms/IPO/BlockExtractor.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/BlockExtractor.cpp +++ llvm/trunk/lib/Transforms/IPO/BlockExtractor.cpp @@ -119,6 +119,8 @@ /*KeepEmpty=*/false); if (LineSplit.empty()) continue; + if (LineSplit.size()!=2) + report_fatal_error("Invalid line format, expecting lines like: 'funcname bb1[;bb2..]'"); SmallVector BBNames; LineSplit[1].split(BBNames, ';', /*MaxSplit=*/-1, /*KeepEmpty=*/false); Index: llvm/trunk/test/Transforms/BlockExtractor/invalid-line.ll =================================================================== --- llvm/trunk/test/Transforms/BlockExtractor/invalid-line.ll +++ llvm/trunk/test/Transforms/BlockExtractor/invalid-line.ll @@ -0,0 +1,9 @@ +; RUN: echo 'foo' > %t +; RUN: not opt -S -extract-blocks -extract-blocks-file=%t %s 2>&1 | FileCheck %s + +; CHECK: Invalid line +define void @bar() { +bb: + ret void +} +