aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorStefan Monnier2001-11-26 23:29:48 +0000
committerStefan Monnier2001-11-26 23:29:48 +0000
commit845975f566069b9b48c21dc2ba239d23c2bd823c (patch)
tree8fac6e1fec7f08f2a2e16581c83e4e675a759294 /src/eval.c
parent111ed14e93300b48add2a69dd42bf50dd8d0c930 (diff)
downloademacs-845975f566069b9b48c21dc2ba239d23c2bd823c.tar.gz
emacs-845975f566069b9b48c21dc2ba239d23c2bd823c.zip
Use AREF and ASIZE.
(Ffetch_bytecode): Add the file name to the error message.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c
index 7593e1440d8..1378e3cae60 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1780,7 +1780,7 @@ Also, a symbol satisfies `commandp' if its function definition does so. */)
1780 have an element whose index is COMPILED_INTERACTIVE, which is 1780 have an element whose index is COMPILED_INTERACTIVE, which is
1781 where the interactive spec is stored. */ 1781 where the interactive spec is stored. */
1782 else if (COMPILEDP (fun)) 1782 else if (COMPILEDP (fun))
1783 return ((XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE 1783 return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE
1784 ? Qt : Qnil); 1784 ? Qt : Qnil);
1785 1785
1786 /* Strings and vectors are keyboard macros. */ 1786 /* Strings and vectors are keyboard macros. */
@@ -2857,7 +2857,7 @@ funcall_lambda (fun, nargs, arg_vector)
2857 return Fsignal (Qinvalid_function, Fcons (fun, Qnil)); 2857 return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
2858 } 2858 }
2859 else if (COMPILEDP (fun)) 2859 else if (COMPILEDP (fun))
2860 syms_left = XVECTOR (fun)->contents[COMPILED_ARGLIST]; 2860 syms_left = AREF (fun, COMPILED_ARGLIST);
2861 else 2861 else
2862 abort (); 2862 abort ();
2863 2863
@@ -2900,11 +2900,11 @@ funcall_lambda (fun, nargs, arg_vector)
2900 { 2900 {
2901 /* If we have not actually read the bytecode string 2901 /* If we have not actually read the bytecode string
2902 and constants vector yet, fetch them from the file. */ 2902 and constants vector yet, fetch them from the file. */
2903 if (CONSP (XVECTOR (fun)->contents[COMPILED_BYTECODE])) 2903 if (CONSP (AREF (fun, COMPILED_BYTECODE)))
2904 Ffetch_bytecode (fun); 2904 Ffetch_bytecode (fun);
2905 val = Fbyte_code (XVECTOR (fun)->contents[COMPILED_BYTECODE], 2905 val = Fbyte_code (AREF (fun, COMPILED_BYTECODE),
2906 XVECTOR (fun)->contents[COMPILED_CONSTANTS], 2906 AREF (fun, COMPILED_CONSTANTS),
2907 XVECTOR (fun)->contents[COMPILED_STACK_DEPTH]); 2907 AREF (fun, COMPILED_STACK_DEPTH));
2908 } 2908 }
2909 2909
2910 return unbind_to (count, val); 2910 return unbind_to (count, val);
@@ -2918,14 +2918,19 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
2918{ 2918{
2919 Lisp_Object tem; 2919 Lisp_Object tem;
2920 2920
2921 if (COMPILEDP (object) 2921 if (COMPILEDP (object) && CONSP (AREF (object, COMPILED_BYTECODE)))
2922 && CONSP (XVECTOR (object)->contents[COMPILED_BYTECODE]))
2923 { 2922 {
2924 tem = read_doc_string (XVECTOR (object)->contents[COMPILED_BYTECODE]); 2923 tem = read_doc_string (AREF (object, COMPILED_BYTECODE));
2925 if (!CONSP (tem)) 2924 if (!CONSP (tem))
2926 error ("invalid byte code"); 2925 {
2927 XVECTOR (object)->contents[COMPILED_BYTECODE] = XCAR (tem); 2926 tem = AREF (object, COMPILED_BYTECODE);
2928 XVECTOR (object)->contents[COMPILED_CONSTANTS] = XCDR (tem); 2927 if (CONSP (tem) && STRINGP (XCAR (tem)))
2928 error ("Invalid byte code in %s", XSTRING (XCAR (tem))->data);
2929 else
2930 error ("Invalid byte code");
2931 }
2932 AREF (object, COMPILED_BYTECODE) = XCAR (tem);
2933 AREF (object, COMPILED_CONSTANTS) = XCDR (tem);
2929 } 2934 }
2930 return object; 2935 return object;
2931} 2936}