/* Consider OBJ if it is (font-spec . [font-entity font-entity ...]). */
if (CONSP (obj) && GC_FONT_SPEC_P (XCAR (obj))
&& !VECTOR_MARKED_P (GC_XFONT_SPEC (XCAR (obj)))
- && VECTORP (XCDR (obj)))
+ /* Don't use VECTORP here, as that calls ASIZE, which could
+ hit assertion violation during GC. */
+ && (VECTORLIKEP (XCDR (obj))
+ && ! (gc_asize (XCDR (obj)) & PSEUDOVECTOR_FLAG)))
{
ptrdiff_t i, size = gc_asize (XCDR (obj));
Lisp_Object obj_cdr = XCDR (obj);