From cecd643ab2de3e4dbd69e76c58b928ab2aa2a80f Mon Sep 17 00:00:00 2001 From: Teddy Date: Wed, 7 Aug 2013 00:56:37 +0800 Subject: list checking fix --- eval.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'eval.cpp') diff --git a/eval.cpp b/eval.cpp index e6e6de1..de43fe8 100644 --- a/eval.cpp +++ b/eval.cpp @@ -71,6 +71,8 @@ void push(Cons * &pc, FrameObj ** &top_ptr, Environment *envt) { throw NormalError(SYN_ERR_EMPTY_COMB); *top_ptr++ = new RetAddr(pc); // Push the return address + if (!is_list(TO_CONS(pc->car))) + throw TokenError(pc->car->ext_repr(), RUN_ERR_WRONG_NUM_OF_ARGS); // static_cast because of is_simple_obj() is false pc = static_cast(pc->car); // Go deeper to enter the call } -- cgit v1.2.3