[PATCH] [MC] report error instead of assertion for non-zero initializer in .bss section

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Fri Jun 20 14:03:11 PDT 2014


================
Comment at: lib/MC/MCAssembler.cpp:787
@@ +786,3 @@
+          if (DF.getContents()[i]) {
+            if (SD->getSection().getVariant() == MCSection::SV_ELF)
+              report_fatal_error("non-zero initializer found in section '" +
----------------
Sorry, what I mean is that you can use the dyn_cast in here. It will return a MCSectionELF or null. So instead of

if (check)
  cast

you have

if (auto *ELFSection = dyn_cast...)
   Use ELFSection

http://reviews.llvm.org/D4199






More information about the llvm-commits mailing list