[ELF] Filter out non InputSection members from InputSections

InputSections may contain MergeInputSection members which trigger
a segmentation fault when trying to cast them to InputSection.

Differential Revision: https://reviews.llvm.org/D33628

llvm-svn: 304189
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 0feb830..7c4bf3a 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -291,6 +291,9 @@
     size_t SizeBefore = Ret.size();
 
     for (InputSectionBase *Sec : InputSections) {
+      if (!isa<InputSection>(Sec))
+        continue;
+
       if (Sec->Assigned)
         continue;