]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix compiler warning.
authorMike Pall <mike>
Tue, 8 Mar 2022 19:05:33 +0000 (20:05 +0100)
committerMike Pall <mike>
Tue, 8 Mar 2022 19:05:33 +0000 (20:05 +0100)
src/lj_opt_fold.c

index 92bdc5533ac64c6e899b2e52098ccdd16a8943a1..7ef09a1f777ce1a035f78275055cb8359be820f5 100644 (file)
@@ -1112,11 +1112,11 @@ LJFOLDF(simplify_nummuldiv_negneg)
 LJFOLD(POW any KNUM)
 LJFOLDF(simplify_numpow_k)
 {
-  if (knumright == 0)  /* x ^ 0 ==> 1 */
+  if (knumright == 0.0)  /* x ^ 0 ==> 1 */
     return lj_ir_knum_one(J);  /* Result must be a number, not an int. */
-  else if (knumright == 1)  /* x ^ 1 ==> x */
+  else if (knumright == 1.0)  /* x ^ 1 ==> x */
     return LEFTFOLD;
-  else if (knumright == 2)  /* x ^ 2 ==> x * x */
+  else if (knumright == 2.0)  /* x ^ 2 ==> x * x */
     return emitir(IRTN(IR_MUL), fins->op1, fins->op1);
   else
     return NEXTFOLD;