This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 4/4] [lambda] [polymorphic] [HACK] Avoid crash on symbol table writing when generic lambda declared with iostream (or potentially other code) included.
- From: Adam Butcher <adam at jessamine dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jason Merrill <jason at redhat dot com>, Adam Butcher <adam at jessamine dot co dot uk>
- Date: Tue, 2 Jul 2013 00:27:01 +0100
- Subject: [PATCH 4/4] [lambda] [polymorphic] [HACK] Avoid crash on symbol table writing when generic lambda declared with iostream (or potentially other code) included.
- References: <1372721221-6201-1-git-send-email-adam at jessamine dot co dot uk>
---
gcc/symtab.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 85d47a8..1ada0f7 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -116,6 +116,15 @@ insert_to_assembler_name_hash (symtab_node node, bool with_clones)
tree name = DECL_ASSEMBLER_NAME (node->symbol.decl);
+
+ // FIXME: how does this nullptr get here when declaring a C++
+ // FIXME: generic lambda and including iostream (or presumably
+ // FIXME: any other header with whatever property is triggering
+ // FIXME: this)!?
+ //
+ if (name == 0)
+ return;
+
aslot = htab_find_slot_with_hash (assembler_name_hash, name,
decl_assembler_name_hash (name),
INSERT);
@@ -156,6 +165,15 @@ unlink_from_assembler_name_hash (symtab_node node, bool with_clones)
else
{
tree name = DECL_ASSEMBLER_NAME (node->symbol.decl);
+
+ // FIXME: how does this nullptr get here when declaring a C++
+ // FIXME: generic lambda and including iostream (or presumably
+ // FIXME: any other header with whatever property is triggering
+ // FIXME: this)!?
+ //
+ if (name == 0)
+ return;
+
void **slot;
slot = htab_find_slot_with_hash (assembler_name_hash, name,
decl_assembler_name_hash (name),
--
1.8.3