summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-04-17 21:19:21 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-04-17 21:19:21 +0000
commit2b8158f441da74d8432c7629b005a7107a44186b (patch)
tree1b1e29b5e3d8203b337b4443a2af1760edf0133b /llvm/lib
parente6ac9f5ec3b890885abef8c4a315203ef02a25e5 (diff)
downloadbcm5719-llvm-2b8158f441da74d8432c7629b005a7107a44186b.tar.gz
bcm5719-llvm-2b8158f441da74d8432c7629b005a7107a44186b.zip
[WebAssembly] Add an assertion for an invalid CFG
Summary: It was not easy to provide a test case for D45648 (rL330079) because the bug didn't manifest itself in the set of currently valid IRs. Added an assertion to check this faster, thanks to @dblaikie's suggestion. Reviewers: dblaikie Subscribers: jfb, dschuff, sbc100, jgravelle-google, llvm-commits, dblaikie Differential Revision: https://reviews.llvm.org/D45711 llvm-svn: 330217
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
index 12664e62a06..9e0a945194b 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
@@ -145,6 +145,9 @@ static void PlaceBlockMarker(
std::prev(InsertPos)->getOpcode() != WebAssembly::END_LOOP)
--InsertPos;
}
+ // The header block in which a 'block' mark will be inserted should have a
+ // terminator because it is branching to a non-layout successor.
+ assert(InsertPos != Header->end());
// Add the BLOCK.
MachineInstr *Begin =
OpenPOWER on IntegriCloud