summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-04-05 15:24:35 -0700
committerGitHub <noreply@github.com>2020-04-06 00:24:35 +0200
commitf1fd3ef7f419e2e2e9675df04aedecef4872f3e9 (patch)
tree153d8d28496e870ff447ea2d1bdef43078cdf4ba /tests/vm
parent87847150bfc89b9b1823c3dfe2b37ebaeadc9ba0 (diff)
downloadNim-f1fd3ef7f419e2e2e9675df04aedecef4872f3e9.tar.gz
fix https://github.com/timotheecour/Nim/issues/88 (#13865) [backport:1.2]
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tref.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/vm/tref.nim b/tests/vm/tref.nim
index f5cd23da5..e70305225 100644
--- a/tests/vm/tref.nim
+++ b/tests/vm/tref.nim
@@ -59,4 +59,13 @@ static:
 static: # bug #8402
   type R = ref object
   var empty: R
-  let otherEmpty = empty
\ No newline at end of file
+  let otherEmpty = empty
+
+block:
+  # fix https://github.com/timotheecour/Nim/issues/88
+  template fun() =
+    var s = @[10,11,12]
+    var a = s[0].addr
+    a[] += 100 # was giving SIGSEGV
+    doAssert a[] == 110
+  static: fun()