aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2011-03-31 00:24:03 -0400
committerStefan Monnier <[email protected]>2011-03-31 00:24:03 -0400
commit40d83b412f584cc02e68d4eac8fd5e6eb769e2fe (patch)
treeb56f27a7e6d75a8c1fd27b00179a27b5efea0a32 /src/bytecode.c
parentf488fb6528738131ef41859e1f04125f2e50efce (diff)
parent44f230aa043ebb222aa0876b44d70484d5dd38db (diff)
Merge from trunk
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index d887668dd3..01ae8055eb 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -425,7 +425,7 @@ according to which any remaining arguments are pushed on the stack
before executing BYTESTR.
usage: (byte-code BYTESTR VECTOR MAXDEP &optional ARGS-TEMPLATE &rest ARGS) */)
- (int nargs, Lisp_Object *args)
+ (size_t nargs, Lisp_Object *args)
{
Lisp_Object args_tmpl = nargs >= 4 ? args[3] : Qnil;
int pnargs = nargs >= 4 ? nargs - 4 : 0;
@@ -631,7 +631,16 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
{
Lisp_Object v1;
v1 = TOP;
- TOP = CAR (v1);
+ if (CONSP (v1))
+ TOP = XCAR (v1);
+ else if (NILP (v1))
+ TOP = Qnil;
+ else
+ {
+ BEFORE_POTENTIAL_GC ();
+ wrong_type_argument (Qlistp, v1);
+ AFTER_POTENTIAL_GC ();
+ }
break;
}
@@ -657,7 +666,17 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
{
Lisp_Object v1;
v1 = TOP;
- TOP = CDR (v1);
+ if (CONSP (v1))
+ TOP = XCDR (v1);
+ else if (NILP (v1))
+ TOP = Qnil;
+ else
+ {
+ BEFORE_POTENTIAL_GC ();
+ wrong_type_argument (Qlistp, v1);
+ AFTER_POTENTIAL_GC ();
+ }
+ break;
break;
}
@@ -994,13 +1013,13 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
v1 = POP;
v2 = TOP;
CHECK_NUMBER (v2);
- AFTER_POTENTIAL_GC ();
op = XINT (v2);
immediate_quit = 1;
while (--op >= 0 && CONSP (v1))
v1 = XCDR (v1);
immediate_quit = 0;
TOP = CAR (v1);
+ AFTER_POTENTIAL_GC ();
break;
}