diff options
Diffstat (limited to 'src/lj_err.c')
-rw-r--r-- | src/lj_err.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lj_err.c b/src/lj_err.c index 12f32af2..2503c218 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -397,7 +397,7 @@ cTValue *lj_err_getframe(lua_State *L, int level, int *size) | |||
397 | if (frame_gc(frame) == obj2gco(L)) | 397 | if (frame_gc(frame) == obj2gco(L)) |
398 | level++; /* Skip dummy frames. See lj_meta_call(). */ | 398 | level++; /* Skip dummy frames. See lj_meta_call(). */ |
399 | if (level-- == 0) { | 399 | if (level-- == 0) { |
400 | *size = cast_int(nextframe - frame); | 400 | *size = (int)(nextframe - frame); |
401 | return frame; /* Level found. */ | 401 | return frame; /* Level found. */ |
402 | } | 402 | } |
403 | nextframe = frame; | 403 | nextframe = frame; |
@@ -418,7 +418,7 @@ LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar) | |||
418 | int size; | 418 | int size; |
419 | cTValue *frame = lj_err_getframe(L, level, &size); | 419 | cTValue *frame = lj_err_getframe(L, level, &size); |
420 | if (frame) { | 420 | if (frame) { |
421 | ar->i_ci = (size << 16) + cast_int(frame - tvref(L->stack)); | 421 | ar->i_ci = (size << 16) + (int)(frame - tvref(L->stack)); |
422 | return 1; | 422 | return 1; |
423 | } else { | 423 | } else { |
424 | ar->i_ci = level - size; | 424 | ar->i_ci = level - size; |
@@ -486,7 +486,7 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode) | |||
486 | if (cframe_canyield(cf)) { /* Resume? */ | 486 | if (cframe_canyield(cf)) { /* Resume? */ |
487 | if (errcode) { | 487 | if (errcode) { |
488 | L->cframe = NULL; | 488 | L->cframe = NULL; |
489 | L->status = cast_byte(errcode); | 489 | L->status = (uint8_t)errcode; |
490 | } | 490 | } |
491 | return cf; | 491 | return cf; |
492 | } | 492 | } |
@@ -534,7 +534,7 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode) | |||
534 | #define LJ_UEXCLASS 0x4c55414a49543200ULL /* LUAJIT2\0 */ | 534 | #define LJ_UEXCLASS 0x4c55414a49543200ULL /* LUAJIT2\0 */ |
535 | #define LJ_UEXCLASS_MAKE(c) (LJ_UEXCLASS | (_Unwind_Exception_Class)(c)) | 535 | #define LJ_UEXCLASS_MAKE(c) (LJ_UEXCLASS | (_Unwind_Exception_Class)(c)) |
536 | #define LJ_UEXCLASS_CHECK(cl) (((cl) ^ LJ_UEXCLASS) <= 0xff) | 536 | #define LJ_UEXCLASS_CHECK(cl) (((cl) ^ LJ_UEXCLASS) <= 0xff) |
537 | #define LJ_UEXCLASS_ERRCODE(cl) (cast_int((cl) & 0xff)) | 537 | #define LJ_UEXCLASS_ERRCODE(cl) ((int)((cl) & 0xff)) |
538 | 538 | ||
539 | /* DWARF2 personality handler referenced from interpreter .eh_frame. */ | 539 | /* DWARF2 personality handler referenced from interpreter .eh_frame. */ |
540 | LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions, | 540 | LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions, |
@@ -642,7 +642,7 @@ extern __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow); | |||
642 | #define LJ_EXCODE ((DWORD)0xe24c4a00) | 642 | #define LJ_EXCODE ((DWORD)0xe24c4a00) |
643 | #define LJ_EXCODE_MAKE(c) (LJ_EXCODE | (DWORD)(c)) | 643 | #define LJ_EXCODE_MAKE(c) (LJ_EXCODE | (DWORD)(c)) |
644 | #define LJ_EXCODE_CHECK(cl) (((cl) ^ LJ_EXCODE) <= 0xff) | 644 | #define LJ_EXCODE_CHECK(cl) (((cl) ^ LJ_EXCODE) <= 0xff) |
645 | #define LJ_EXCODE_ERRCODE(cl) (cast_int((cl) & 0xff)) | 645 | #define LJ_EXCODE_ERRCODE(cl) ((int)((cl) & 0xff)) |
646 | 646 | ||
647 | /* Win64 exception handler for interpreter frame. */ | 647 | /* Win64 exception handler for interpreter frame. */ |
648 | LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win64(EXCEPTION_RECORD *rec, | 648 | LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win64(EXCEPTION_RECORD *rec, |
@@ -945,7 +945,7 @@ LJ_NORET LJ_NOINLINE static void err_argmsg(lua_State *L, int narg, | |||
945 | const char *fname = "?"; | 945 | const char *fname = "?"; |
946 | const char *ftype = getfuncname(L, L->base - 1, &fname); | 946 | const char *ftype = getfuncname(L, L->base - 1, &fname); |
947 | if (narg < 0 && narg > LUA_REGISTRYINDEX) | 947 | if (narg < 0 && narg > LUA_REGISTRYINDEX) |
948 | narg = cast_int(L->top - L->base) + narg + 1; | 948 | narg = (int)(L->top - L->base) + narg + 1; |
949 | if (ftype && ftype[3] == 'h' && --narg == 0) /* Check for "method". */ | 949 | if (ftype && ftype[3] == 'h' && --narg == 0) /* Check for "method". */ |
950 | msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg); | 950 | msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg); |
951 | else | 951 | else |