From 233072f045bcd2459ed97edbec1edb6ddcce9381 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 21 Feb 2024 11:57:10 -0800 Subject: [PATCH] luau-compile: Fix usage of vector-ctor without vector-lib When --vector-lib is not specified, CompileOptions::vectorLib was set to an empty string. This resulted in the builtin matching not working, since vectorLib must either be a null pointer or a pointer to a valid global identifier. --- CLI/Compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLI/Compile.cpp b/CLI/Compile.cpp index c993d308..06d8bb4c 100644 --- a/CLI/Compile.cpp +++ b/CLI/Compile.cpp @@ -59,7 +59,7 @@ static Luau::CompileOptions copts() result.debugLevel = globalOptions.debugLevel; // globalOptions outlive the CompileOptions, so it's safe to use string data pointers here - result.vectorLib = globalOptions.vectorLib.c_str(); + result.vectorLib = globalOptions.vectorLib.empty() ? nullptr : globalOptions.vectorLib.c_str(); result.vectorCtor = globalOptions.vectorCtor.c_str(); result.vectorType = globalOptions.vectorType.c_str();