aboutsummaryrefslogtreecommitdiff
path: root/eval.cpp
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-04 16:19:29 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-04 16:19:29 +0800
commit418f6ed5dd00e296b87b202a99753632fc593382 (patch)
tree7e372342b3fa116c7c695ac8f77c2b994dc1bd44 /eval.cpp
parent65f17438de5983ca010e10b4b24c5da65756a9b5 (diff)
added more error report
Diffstat (limited to 'eval.cpp')
-rw-r--r--eval.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.cpp b/eval.cpp
index dd4be00..efd1114 100644
--- a/eval.cpp
+++ b/eval.cpp
@@ -43,6 +43,9 @@ void push(Cons * &pc, FrameObj ** &top_ptr, Environment *envt) {
}
else // Operational Invocation
{
+ if (pc->car == empty_list)
+ throw NormalError(SYN_ERR_EMPTY_COMB);
+
*top_ptr++ = new RetAddr(pc); // Push the return address
// static_cast because of is_simple_obj() is false
pc = static_cast<Cons*>(pc->car); // Go deeper to enter the call