Update Compiler.cpp

This commit is contained in:
rafa_br34 2022-01-12 06:12:23 -03:00 committed by GitHub
parent 77d9e8c038
commit 3c01448312
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -364,12 +364,12 @@ struct Compiler
else else
{ {
args[i] = uint8_t(regs + 1 + i); args[i] = uint8_t(regs + 1 + i);
compileExprTempTop(expr->args.data[i], args[i]); compileExprTempTop(expr->args.data[i], uint8_t(args[i]));
} }
} }
fastcallLabel = bytecode.emitLabel(); fastcallLabel = bytecode.emitLabel();
bytecode.emitABC(opc, uint8_t(bfid), args[0], 0); bytecode.emitABC(opc, uint8_t(bfid), uint8_t(args[0]), uint8_t(0));
if (opc != LOP_FASTCALL1) if (opc != LOP_FASTCALL1)
bytecode.emitAux(args[1]); bytecode.emitAux(args[1]);
@ -385,7 +385,7 @@ struct Compiler
} }
if (args[i] != regs + 1 + i) if (args[i] != regs + 1 + i)
bytecode.emitABC(LOP_MOVE, uint8_t(regs + 1 + i), args[i], 0); bytecode.emitABC(LOP_MOVE, uint8_t(regs + 1 + i), uint8_t(args[i]), uint8_t(0));
} }
} }
else else
@ -471,7 +471,7 @@ struct Compiler
if (cid >= 0 && cid < 32768) if (cid >= 0 && cid < 32768)
{ {
bytecode.emitAD(LOP_DUPCLOSURE, target, cid); bytecode.emitAD(LOP_DUPCLOSURE, target, uint16_t(cid));
shared = true; shared = true;
} }
} }
@ -493,7 +493,7 @@ struct Compiler
// get local variable // get local variable
uint8_t reg = getLocal(uv); uint8_t reg = getLocal(uv);
bytecode.emitABC(LOP_CAPTURE, immutable ? LCT_VAL : LCT_REF, reg, 0); bytecode.emitABC(LOP_CAPTURE, uint8_t(immutable ? LCT_VAL : LCT_REF), reg, 0);
} }
else else
{ {
@ -635,7 +635,7 @@ struct Compiler
if (expr->op == AstExprBinary::CompareGt || expr->op == AstExprBinary::CompareGe) if (expr->op == AstExprBinary::CompareGt || expr->op == AstExprBinary::CompareGe)
{ {
bytecode.emitAD(opc, rr, 0); bytecode.emitAD(opc, uint8_t(rr), 0);
bytecode.emitAux(rl); bytecode.emitAux(rl);
} }
else else
@ -1144,7 +1144,7 @@ struct Compiler
} }
else else
{ {
bytecode.emitABC(LOP_NEWTABLE, reg, encodedHashSize, 0); bytecode.emitABC(LOP_NEWTABLE, reg, uint8_t(encodedHashSize), 0);
bytecode.emitAux(0); bytecode.emitAux(0);
} }
} }
@ -1157,7 +1157,7 @@ struct Compiler
bool trailingVarargs = last && last->kind == AstExprTable::Item::List && last->value->is<AstExprVarargs>(); bool trailingVarargs = last && last->kind == AstExprTable::Item::List && last->value->is<AstExprVarargs>();
LUAU_ASSERT(!trailingVarargs || arraySize > 0); LUAU_ASSERT(!trailingVarargs || arraySize > 0);
bytecode.emitABC(LOP_NEWTABLE, reg, encodedHashSize, 0); bytecode.emitABC(LOP_NEWTABLE, reg, uint8_t(encodedHashSize), 0);
bytecode.emitAux(arraySize - trailingVarargs + indexSize); bytecode.emitAux(arraySize - trailingVarargs + indexSize);
} }