Improve assertions.
This commit is contained in:
@@ -320,7 +320,7 @@ SBuf *lj_strfmt_putfxint(SBuf *sb, SFormat sf, uint64_t k)
|
||||
if ((sf & STRFMT_F_LEFT))
|
||||
while (width-- > pprec) *p++ = ' ';
|
||||
|
||||
lua_assert(need == (MSize)(p - ps));
|
||||
lj_assertX(need == (MSize)(p - ps), "miscalculated format size");
|
||||
setsbufP(sb, p);
|
||||
return sb;
|
||||
}
|
||||
@@ -449,7 +449,7 @@ const char *lj_strfmt_pushvf(lua_State *L, const char *fmt, va_list argp)
|
||||
case STRFMT_ERR:
|
||||
default:
|
||||
lj_buf_putb(sb, '?');
|
||||
lua_assert(0);
|
||||
lj_assertL(0, "bad string format near offset %d", fs.len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user