fix dangling ptr issue

This commit is contained in:
Pelanyo Kamara 2021-11-09 15:28:18 +00:00
parent 67f2db3cbd
commit a81fecb564
No known key found for this signature in database
GPG key ID: 1C8B9C40A2527035
3 changed files with 31 additions and 26 deletions

View file

@ -83,27 +83,3 @@ jobs:
with:
name: coverage
path: coverage
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup emsdk
uses: mymindstorm/setup-emsdk@v9
with:
version: 1.38.40
actions-cache-folder: 'emsdk-cache'
- name: verify emsdk
run: |
emcc -v # verify emscripten installed successfully
- name: cmake configure
run: |
emcmake cmake .
- name: build
run: |
cmake --build . --target Luau.Repl.CLI --config Debug # as seen above but only Repl.CLI.
- uses: actions/upload-artifact@v2
with:
name: luau-web-artifacts
path: docs/assets/luau/
if-no-files-found: error

View file

@ -33,3 +33,31 @@ jobs:
with:
name: luau-${{matrix.os}}
path: Release\luau*.exe
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup emsdk
uses: mymindstorm/setup-emsdk@v9
with:
version: 1.38.40
actions-cache-folder: 'emsdk-cache'
- name: verify emsdk
run: |
emcc -v # verify emscripten installed successfully
- name: cmake configure
run: |
emcmake cmake .
- name: build
run: |
cmake --build . --target Luau.Repl.CLI --config Debug # as seen above but only Repl.CLI.
- uses: actions/upload-artifact@v2
with:
name: luau.wasm
path: docs/assets/luau/luau.wasm
if-no-files-found: error
- uses: actions/upload-artifact@v2
with:
name: luau.js
path: docs/assets/luau/luau.js
if-no-files-found: error

View file

@ -223,9 +223,10 @@ extern "C"
std::string error = runCode(L, source);
// output error(s)
static std::string result = error;
if (error.length())
{
return std::move(error.c_str());
return result.c_str();
}
return NULL;
}