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.
This commit is contained in:
Arseny Kapoulkine 2024-02-21 11:57:10 -08:00
parent 80928acb92
commit 233072f045

View file

@ -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();