Skip to content

Commit

Permalink
fix logic issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MathematicalDessert committed Nov 9, 2021
1 parent a81fecb commit 80ff5e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage
path: coverage
8 changes: 5 additions & 3 deletions CLI/Repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ extern "C"
{
const char* executeScript(const char* source)
{
// static string for caching result (prevents dangling ptr on function exit)
static std::string result;

// setup flags
for (Luau::FValue<bool>* flag = Luau::FValue<bool>::list; flag; flag = flag->next)
if (strncmp(flag->name, "Luau", 4) == 0)
Expand All @@ -221,9 +224,8 @@ extern "C"

// run code + collect error
std::string error = runCode(L, source);

// output error(s)
static std::string result = error;
result = error;

if (error.length())
{
return result.c_str();
Expand Down

0 comments on commit 80ff5e3

Please sign in to comment.