diff options
Diffstat (limited to 'src/buildvm_x86.dasc')
-rw-r--r-- | src/buildvm_x86.dasc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc index f7631d62..17dcae2d 100644 --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc | |||
@@ -3753,6 +3753,16 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) | |||
3753 | #endif | 3753 | #endif |
3754 | | | 3754 | | |
3755 | |//----------------------------------------------------------------------- | 3755 | |//----------------------------------------------------------------------- |
3756 | |//-- Assertions --------------------------------------------------------- | ||
3757 | |//----------------------------------------------------------------------- | ||
3758 | | | ||
3759 | |->assert_bad_for_arg_type: | ||
3760 | #ifdef LUA_USE_ASSERT | ||
3761 | | int3 | ||
3762 | #endif | ||
3763 | | int3 | ||
3764 | | | ||
3765 | |//----------------------------------------------------------------------- | ||
3756 | } | 3766 | } |
3757 | 3767 | ||
3758 | /* Generate the code for a single instruction. */ | 3768 | /* Generate the code for a single instruction. */ |
@@ -5534,6 +5544,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
5534 | | mov RB, dword FOR_IDX | 5544 | | mov RB, dword FOR_IDX |
5535 | | cmp dword FOR_STEP, 0; jl >5 | 5545 | | cmp dword FOR_STEP, 0; jl >5 |
5536 | } else { | 5546 | } else { |
5547 | #ifdef LUA_USE_ASSERT | ||
5548 | | cmp FOR_TSTOP, LJ_TISNUM; jne ->assert_bad_for_arg_type | ||
5549 | | cmp FOR_TSTEP, LJ_TISNUM; jne ->assert_bad_for_arg_type | ||
5550 | #endif | ||
5537 | | mov RB, dword FOR_STEP | 5551 | | mov RB, dword FOR_STEP |
5538 | | test RB, RB; js >5 | 5552 | | test RB, RB; js >5 |
5539 | | add RB, dword FOR_IDX; jo >1 | 5553 | | add RB, dword FOR_IDX; jo >1 |
@@ -5593,6 +5607,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
5593 | if (!vk) { | 5607 | if (!vk) { |
5594 | | jae ->vmeta_for | 5608 | | jae ->vmeta_for |
5595 | | cmp FOR_TSTOP, LJ_TISNUM; jae ->vmeta_for | 5609 | | cmp FOR_TSTOP, LJ_TISNUM; jae ->vmeta_for |
5610 | } else { | ||
5611 | #ifdef LUA_USE_ASSERT | ||
5612 | | cmp FOR_TSTOP, LJ_TISNUM; jae ->assert_bad_for_arg_type | ||
5613 | | cmp FOR_TSTEP, LJ_TISNUM; jae ->assert_bad_for_arg_type | ||
5614 | #endif | ||
5596 | } | 5615 | } |
5597 | | mov RB, FOR_TSTEP // Load type/hiword of for step. | 5616 | | mov RB, FOR_TSTEP // Load type/hiword of for step. |
5598 | if (!vk) { | 5617 | if (!vk) { |