aboutsummaryrefslogtreecommitdiff
path: root/src/lj_carith.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_carith.c')
-rw-r--r--src/lj_carith.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lj_carith.c b/src/lj_carith.c
index cf71aaf5..65ad2c10 100644
--- a/src/lj_carith.c
+++ b/src/lj_carith.c
@@ -122,7 +122,7 @@ static int carith_ptr(lua_State *L, CTState *cts, CDArith *ca, MMS mm)
122 setboolV(L->top-1, ((uintptr_t)pp < (uintptr_t)pp2)); 122 setboolV(L->top-1, ((uintptr_t)pp < (uintptr_t)pp2));
123 return 1; 123 return 1;
124 } else { 124 } else {
125 lua_assert(mm == MM_le); 125 lj_assertL(mm == MM_le, "bad metamethod %d", mm);
126 setboolV(L->top-1, ((uintptr_t)pp <= (uintptr_t)pp2)); 126 setboolV(L->top-1, ((uintptr_t)pp <= (uintptr_t)pp2));
127 return 1; 127 return 1;
128 } 128 }
@@ -208,7 +208,9 @@ static int carith_int64(lua_State *L, CTState *cts, CDArith *ca, MMS mm)
208 *up = lj_carith_powu64(u0, u1); 208 *up = lj_carith_powu64(u0, u1);
209 break; 209 break;
210 case MM_unm: *up = (uint64_t)-(int64_t)u0; break; 210 case MM_unm: *up = (uint64_t)-(int64_t)u0; break;
211 default: lua_assert(0); break; 211 default:
212 lj_assertL(0, "bad metamethod %d", mm);
213 break;
212 } 214 }
213 lj_gc_check(L); 215 lj_gc_check(L);
214 return 1; 216 return 1;
@@ -301,7 +303,9 @@ uint64_t lj_carith_shift64(uint64_t x, int32_t sh, int op)
301 case IR_BSAR-IR_BSHL: x = lj_carith_sar64(x, sh); break; 303 case IR_BSAR-IR_BSHL: x = lj_carith_sar64(x, sh); break;
302 case IR_BROL-IR_BSHL: x = lj_carith_rol64(x, sh); break; 304 case IR_BROL-IR_BSHL: x = lj_carith_rol64(x, sh); break;
303 case IR_BROR-IR_BSHL: x = lj_carith_ror64(x, sh); break; 305 case IR_BROR-IR_BSHL: x = lj_carith_ror64(x, sh); break;
304 default: lua_assert(0); break; 306 default:
307 lj_assertX(0, "bad shift op %d", op);
308 break;
305 } 309 }
306 return x; 310 return x;
307} 311}