From 6e1f65b41fa0c6f12f301c607a1b660213153033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Fri, 10 Nov 2023 15:49:45 +0200 Subject: [PATCH 1/3] Update Compiler/src/Compiler.cpp Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> --- Compiler/src/Compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compiler/src/Compiler.cpp b/Compiler/src/Compiler.cpp index a7eedfc4..7bb70201 100644 --- a/Compiler/src/Compiler.cpp +++ b/Compiler/src/Compiler.cpp @@ -1131,7 +1131,7 @@ struct Compiler } // disable fast path for vectors because supporting it would require a new opcode - if (isConstantVector(right)) + if (operandIsConstant && isConstantVector(right)) operandIsConstant = false; uint8_t rl = compileExprAuto(left, rs); From bbe06c00c67f83d63674b6fa8f8f54117ce692db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Fri, 10 Nov 2023 15:51:05 +0200 Subject: [PATCH 2/3] Update tests/Compiler.test.cpp Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> --- tests/Compiler.test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index 4f2f7ac2..c85dbb5c 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -4498,7 +4498,7 @@ TEST_CASE("VectorLiterals") { ScopedFastFlag sff("LuauVectorLiterals", true); - CHECK_EQ("\n" + compileFunction("return Vector3.new(1, 2, 3)", 0, 2, true), R"( + CHECK_EQ("\n" + compileFunction("return Vector3.new(1, 2, 3)", 0, 2, /*enableVectors*/ true), R"( LOADK R0 K0 [1, 2, 3] RETURN R0 1 )"); From d4f6c50f9f2199edb133f0494729996b4934e069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Fri, 10 Nov 2023 15:51:16 +0200 Subject: [PATCH 3/3] Update tests/Compiler.test.cpp Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> --- tests/Compiler.test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index c85dbb5c..112c58e9 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -4503,7 +4503,7 @@ LOADK R0 K0 [1, 2, 3] RETURN R0 1 )"); - CHECK_EQ("\n" + compileFunction("print(Vector3.new(1, 2, 3))", 0, 2, true), R"( + CHECK_EQ("\n" + compileFunction("print(Vector3.new(1, 2, 3))", 0, 2, /*enableVectors*/ true), R"( GETIMPORT R0 1 [print] LOADK R1 K2 [1, 2, 3] CALL R0 1 0