summaryrefslogtreecommitdiff
path: root/6/simp.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-24 23:24:43 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-24 23:25:30 -0800
commitda0fa1a6453838369e8d31f75d2a67777711adba (patch)
treeef2f0bc65f008de360789d89d7db06671fe57bf0 /6/simp.c
parentc6b35c0012479ebe927bf479519678a863d0d328 (diff)
downloadmc-da0fa1a6453838369e8d31f75d2a67777711adba.tar.gz
Fix destructuring of nested tuples.
Fixes #92
Diffstat (limited to '6/simp.c')
-rw-r--r--6/simp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/6/simp.c b/6/simp.c
index 1c0b1d8..5415420 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -1473,10 +1473,11 @@ void simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, s
s.blobs = *blob;
s.nblobs = *nblob;
s.hasenv = 0;
- name = asmname(dcl);
if (dcl->decl.isextern || dcl->decl.isgeneric)
return;
+
+ name = asmname(dcl);
if (isconstfn(dcl)) {
f = simpfn(&s, name, dcl);
lappend(fn, nfn, f);
@@ -1485,5 +1486,6 @@ void simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, s
}
*blob = s.blobs;
*nblob = s.nblobs;
+
free(name);
}