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

Reid Kleckner rnk at google.com
Wed Jun 18 15:37:29 PDT 2014


This seems like an OK diagnostic for now in LLVM, but eventually we will need one in clang.

================
Comment at: lib/MC/MCAssembler.cpp:789-790
@@ +788,4 @@
+            if (SD->getSection().getVariant() == MCSection::SV_ELF)
+              SecName = "section '" + static_cast<const MCSectionELF&>
+                (SD->getSection()).getSectionName().str()  + "'";
+            report_fatal_error("non-zero initializer found in " + SecName);
----------------
This creates a StringRef that points to a destroyed std::string.

http://reviews.llvm.org/D4199






More information about the llvm-commits mailing list