Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- name: Install dependencies
run: nimble install -y bumpy chroma vmath
- name: Build test DLL
run: nim c --mm:arc --app:lib -d:gennyNim -o:tests/generated/libtest.so tests/test.nim
run: nim c -d:release --mm:arc --app:lib -d:gennyNim -o:tests/generated/libtest.so tests/test.nim
- name: Run Nim-C-Nim sandwich test
run: |
nim c --mm:arc -o:tests/generated/test_nim tests/test_nim.nim
nim c -d:release --mm:arc -o:tests/generated/test_nim tests/test_nim.nim
cd tests/generated && LD_LIBRARY_PATH=. ./test_nim
- name: Build Pixie bindings
run: cd ../pixie && nim c --mm:arc --app:lib -d:gennyNim --path:../genny/src --path:src -o:bindings/generated/libpixie.so bindings/bindings.nim
Expand Down
12 changes: 12 additions & 0 deletions tests/test_nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ block:
doAssert refObj.simpleRefB == 50, "simpleRefB should be 50"
refObj.doit()

echo "Testing issue #54 ref object method lifetime"
proc issue54CrashAfterAccess() =
var s2 = newSimpleRefObj()
s2.simpleRefA = 3
doAssert s2.simpleRefA == 3, "simpleRefA should first be 3"
s2.simpleRefA = 8
doAssert s2.simpleRefA == 8, "simpleRefA should update to 8"
s2.doit()

issue54CrashAfterAccess()
doAssert simpleCall(42) == 42, "execution should continue after issue #54 regression"

echo "Testing SeqInt"
block:
let seqInt = newSeqInt()
Expand Down
Loading