diff options
author | David Robillard <d@drobilla.net> | 2010-12-28 19:45:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-28 19:45:48 +0000 |
commit | 33eb9bb5097e3e9c16529fca87f5f12300cc21d7 (patch) | |
tree | 5f9885d5a0462267e171502c7f1bf18c076ec861 | |
parent | f0bbe766b9cfd14f09e847519b84cf7025839486 (diff) | |
download | resp-33eb9bb5097e3e9c16529fca87f5f12300cc21d7.tar.gz resp-33eb9bb5097e3e9c16529fca87f5f12300cc21d7.tar.bz2 resp-33eb9bb5097e3e9c16529fca87f5f12300cc21d7.zip |
Fix crash when def name is not a symbol.
git-svn-id: http://svn.drobilla.net/resp/resp@367 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | src/expand.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expand.cpp b/src/expand.cpp index d10b64d..53a415c 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -56,9 +56,7 @@ expand_def(PEnv& penv, const AST* exp, void* arg) THROW_IF(i == tup->end(), tup->loc, "Unexpected end of `def' form"); const AST* arg1 = *(++i); THROW_IF(i == tup->end(), arg1->loc, "Unexpected end of `def' form"); - if (arg1->to_symbol()) { - return expand_list(penv, tup); - } else { + if (arg1->to_tuple()) { // (def (f x) y) => (def f (fn (x) y)) const ATuple* pat = arg1->to_tuple(); @@ -83,6 +81,8 @@ expand_def(PEnv& penv, const AST* exp, void* arg) ret.head->loc = exp->loc; return expand_list(penv, ret.head); + } else { + return expand_list(penv, tup); } } |