mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Fix assert failures with extra conformance tests
This commit is contained in:
parent
574130756f
commit
33c48485f1
3 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,9 @@ static Constant ctype(const Constant& c)
|
|||
case Constant::Type_Number:
|
||||
return cstring("number");
|
||||
|
||||
case Constant::Type_Vector:
|
||||
return cstring("vector");
|
||||
|
||||
case Constant::Type_String:
|
||||
return cstring("string");
|
||||
|
||||
|
|
|
@ -1232,6 +1232,10 @@ struct Compiler
|
|||
cid = bytecode.addConstantNumber(c->valueNumber);
|
||||
break;
|
||||
|
||||
case Constant::Type_Vector:
|
||||
cid = bytecode.addConstantVector(c->valueVector[0], c->valueVector[1], c->valueVector[2]);
|
||||
break;
|
||||
|
||||
case Constant::Type_String:
|
||||
cid = bytecode.addConstantString(sref(c->getString()));
|
||||
break;
|
||||
|
|
|
@ -26,6 +26,12 @@ static bool constantsEqual(const Constant& la, const Constant& ra)
|
|||
case Constant::Type_Number:
|
||||
return ra.type == Constant::Type_Number && la.valueNumber == ra.valueNumber;
|
||||
|
||||
case Constant::Type_Vector:
|
||||
return ra.type == Constant::Type_Vector &&
|
||||
la.valueVector[0] == ra.valueVector[0] &&
|
||||
la.valueVector[1] == ra.valueVector[1] &&
|
||||
la.valueVector[2] == ra.valueVector[2];
|
||||
|
||||
case Constant::Type_String:
|
||||
return ra.type == Constant::Type_String && la.stringLength == ra.stringLength && memcmp(la.valueString, ra.valueString, la.stringLength) == 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue