mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
fix logic issue
This commit is contained in:
parent
a81fecb564
commit
80ff5e3e63
2 changed files with 6 additions and 4 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -82,4 +82,4 @@ jobs:
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: coverage
|
name: coverage
|
||||||
path: coverage
|
path: coverage
|
||||||
|
|
|
@ -204,6 +204,9 @@ extern "C"
|
||||||
{
|
{
|
||||||
const char* executeScript(const char* source)
|
const char* executeScript(const char* source)
|
||||||
{
|
{
|
||||||
|
// static string for caching result (prevents dangling ptr on function exit)
|
||||||
|
static std::string result;
|
||||||
|
|
||||||
// setup flags
|
// setup flags
|
||||||
for (Luau::FValue<bool>* flag = Luau::FValue<bool>::list; flag; flag = flag->next)
|
for (Luau::FValue<bool>* flag = Luau::FValue<bool>::list; flag; flag = flag->next)
|
||||||
if (strncmp(flag->name, "Luau", 4) == 0)
|
if (strncmp(flag->name, "Luau", 4) == 0)
|
||||||
|
@ -221,9 +224,8 @@ extern "C"
|
||||||
|
|
||||||
// run code + collect error
|
// run code + collect error
|
||||||
std::string error = runCode(L, source);
|
std::string error = runCode(L, source);
|
||||||
|
result = error;
|
||||||
// output error(s)
|
|
||||||
static std::string result = error;
|
|
||||||
if (error.length())
|
if (error.length())
|
||||||
{
|
{
|
||||||
return result.c_str();
|
return result.c_str();
|
||||||
|
|
Loading…
Add table
Reference in a new issue