Move assert above first use of variable that we'd be asserting on.
authorEric Christopher <echristo@gmail.com>
Wed, 7 Aug 2013 18:51:09 +0000 (18:51 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 7 Aug 2013 18:51:09 +0000 (18:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187899 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCAssembler.cpp

index 24f4b8e635ea4101482ced848a08d4b7c4f1f05d..68111f187d38030472dc9d8dcdcfd87acb751fa8 100644 (file)
@@ -580,10 +580,10 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
   case MCFragment::FT_Align: {
     ++stats::EmittedAlignFragments;
     const MCAlignFragment &AF = cast<MCAlignFragment>(F);
   case MCFragment::FT_Align: {
     ++stats::EmittedAlignFragments;
     const MCAlignFragment &AF = cast<MCAlignFragment>(F);
-    uint64_t Count = FragmentSize / AF.getValueSize();
-
     assert(AF.getValueSize() && "Invalid virtual align in concrete fragment!");
 
     assert(AF.getValueSize() && "Invalid virtual align in concrete fragment!");
 
+    uint64_t Count = FragmentSize / AF.getValueSize();
+
     // FIXME: This error shouldn't actually occur (the front end should emit
     // multiple .align directives to enforce the semantics it wants), but is
     // severe enough that we want to report it. How to handle this?
     // FIXME: This error shouldn't actually occur (the front end should emit
     // multiple .align directives to enforce the semantics it wants), but is
     // severe enough that we want to report it. How to handle this?