=== modified file 'src/alloc.c' --- src/alloc.c 2014-04-03 00:37:51 +0000 +++ src/alloc.c 2014-04-03 13:59:58 +0000 @@ -3382,6 +3382,13 @@ CHECK_STRING (name); + /* If not loadup, avoid symbols with names from pure space. + Current GC has problems treating such a symbols - see + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17168. */ + if (NILP (Vpurify_flag) && PURE_POINTER_P (XPNTR (name))) + name = make_specified_string (SSDATA (name), SCHARS (name), + SBYTES (name), STRING_MULTIBYTE (name)); + MALLOC_BLOCK_INPUT; if (symbol_free_list) @@ -6174,6 +6181,12 @@ break; CHECK_ALLOCATED_AND_LIVE (live_symbol_p); ptr->gcmarkbit = 1; + /* Attempt to catch bogus objects. In particular, see + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17168. */ + eassert (SYMBOLP (ptr->function) + || CONSP (ptr->function) + || COMPILEDP (ptr->function) + || SUBRP (ptr->function)); mark_object (ptr->function); mark_object (ptr->plist); switch (ptr->redirect) @@ -6601,6 +6614,12 @@ if (!pure_p) eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); sym->s.gcmarkbit = 0; + /* Attempt to catch bogus objects. In particular, see + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17168. */ + eassert (SYMBOLP (sym->s.function) + || CONSP (sym->s.function) + || COMPILEDP (sym->s.function) + || SUBRP (sym->s.function)); } }