From 91b50ff72939206e971e818e3b65105498923916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Fri, 10 Nov 2023 15:56:57 +0200 Subject: [PATCH] Revert bytecode version to 4 unless LuaVectorLiterals flag is enabled --- Common/include/Luau/Bytecode.h | 2 +- Compiler/src/BytecodeBuilder.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Common/include/Luau/Bytecode.h b/Common/include/Luau/Bytecode.h index 88e422f2..ba9d72a1 100644 --- a/Common/include/Luau/Bytecode.h +++ b/Common/include/Luau/Bytecode.h @@ -427,7 +427,7 @@ enum LuauBytecodeTag // Bytecode version; runtime supports [MIN, MAX], compiler emits TARGET by default but may emit a higher version when flags are enabled LBC_VERSION_MIN = 3, LBC_VERSION_MAX = 5, - LBC_VERSION_TARGET = 5, + LBC_VERSION_TARGET = 4, // Type encoding version LBC_TYPE_VERSION = 1, // Types of constant table entries diff --git a/Compiler/src/BytecodeBuilder.cpp b/Compiler/src/BytecodeBuilder.cpp index 2907f98c..69b05e53 100644 --- a/Compiler/src/BytecodeBuilder.cpp +++ b/Compiler/src/BytecodeBuilder.cpp @@ -8,6 +8,7 @@ #include LUAU_FASTFLAG(LuauFloorDivision) +LUAU_FASTFLAG(LuauVectorLiterals) namespace Luau { @@ -1113,7 +1114,7 @@ std::string BytecodeBuilder::getError(const std::string& message) uint8_t BytecodeBuilder::getVersion() { // This function usually returns LBC_VERSION_TARGET but may sometimes return a higher number (within LBC_VERSION_MIN/MAX) under fast flags - return LBC_VERSION_TARGET; + return (FFlag::LuauVectorLiterals ? 5 : LBC_VERSION_TARGET); } uint8_t BytecodeBuilder::getTypeEncodingVersion()