From 55e7656640de92645965d02dc1a155a1e2c39545 Mon Sep 17 00:00:00 2001 From: Luke Gorrie Date: Mon, 8 Oct 2018 21:43:02 +0000 Subject: [PATCH] lj_ctype.c: Detect bad ctypeid without failing lua_assert --- src/lj_ctype.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lj_ctype.c b/src/lj_ctype.c index eaccb781c0..ca3694bf78 100644 --- a/src/lj_ctype.c +++ b/src/lj_ctype.c @@ -533,6 +533,10 @@ static void ctype_repr(CTRepr *ctr, CTypeID id) ctr->ok = 0; return; } + if (ctype_cid(info) == 0) { + ctr->ok = 0; + return; + } newct = ctype_get(ctr->cts, ctype_cid(info)); /* Detect ctypes that are not OK due to looping. */ if (newct == ct) {