Improve assertions.
This commit is contained in:
@@ -101,9 +101,6 @@ static int io_file_close(lua_State *L, IOFileUD *iof)
|
||||
stat = pclose(iof->fp);
|
||||
#elif LJ_TARGET_WINDOWS && !LJ_TARGET_XBOXONE && !LJ_TARGET_UWP
|
||||
stat = _pclose(iof->fp);
|
||||
#else
|
||||
lua_assert(0);
|
||||
return 0;
|
||||
#endif
|
||||
#if LJ_52
|
||||
iof->fp = NULL;
|
||||
@@ -112,7 +109,8 @@ static int io_file_close(lua_State *L, IOFileUD *iof)
|
||||
ok = (stat != -1);
|
||||
#endif
|
||||
} else {
|
||||
lua_assert((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_STDF);
|
||||
lj_assertL((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_STDF,
|
||||
"close of unknown FILE* type");
|
||||
setnilV(L->top++);
|
||||
lua_pushliteral(L, "cannot close standard file");
|
||||
return 2;
|
||||
|
||||
Reference in New Issue
Block a user