\f
/* Fetch the next byte from the bytecode stream. */
-#define FETCH (*pc++)
+#define FETCH (last_pc = pc, *pc++)
+#define FETCH_NORECORD (*pc++)
/* Fetch two bytes from the bytecode stream and make a 16-bit number
out of them. */
-#define FETCH2 (op = FETCH, op + (FETCH << 8))
+#define FETCH2 (op = FETCH, op + (FETCH_NORECORD << 8))
/* Push X onto the execution stack. The expression X should not
contain TOP, to avoid competing side effects. */
bytestr_data = ptr_bounds_clip (bytestr_data + item_bytes, bytestr_length);
memcpy (bytestr_data, SDATA (bytestr), bytestr_length);
unsigned char const *pc = bytestr_data;
+ unsigned char const *last_pc = pc;
ptrdiff_t count = SPECPDL_INDEX ();
if (!NILP (args_template))
if (CONSP (TOP))
TOP = XCDR (TOP);
else if (!NILP (TOP))
- wrong_type_argument (Qlistp, TOP);
+ wrong_type_argument_new (Qlistp, TOP, last_pc - bytestr_data);
NEXT;
}
xsignal2 (Qwrong_type_argument, predicate, value);
}
+AVOID
+wrong_type_argument_new (Lisp_Object predicate, Lisp_Object value,
+ int bytecode_offset)
+{
+ eassert (!TAGGEDP (value, Lisp_Type_Unused0));
+ xsignal2_new (Qwrong_type_argument, predicate, value, bytecode_offset);
+}
+
void
pure_write_error (Lisp_Object obj)
{
xsignal (error_symbol, list2 (arg1, arg2));
}
+void
+xsignal2_new (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2, int bytecode_offset)
+{
+ xsignal (error_symbol, list3 (arg1, arg2, make_fixnum(bytecode_offset)));
+}
+
void
xsignal3 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
/* Defined in data.c. */
extern AVOID args_out_of_range_3 (Lisp_Object, Lisp_Object, Lisp_Object);
extern AVOID wrong_type_argument (Lisp_Object, Lisp_Object);
+extern AVOID wrong_type_argument_new (Lisp_Object, Lisp_Object, int bytecode_offset);
extern Lisp_Object default_value (Lisp_Object symbol);
enum nonlocal_exit nonlocal_exit;
Lisp_Object val;
+ /* The bytecode offset where the error occurred. */
+ int bytecode_offset;
+
struct handler *next;
struct handler *nextfree;
extern AVOID xsignal0 (Lisp_Object);
extern AVOID xsignal1 (Lisp_Object, Lisp_Object);
extern AVOID xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object);
+extern AVOID xsignal2_new (Lisp_Object, Lisp_Object, Lisp_Object, int bytecode_offset);
extern AVOID xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
extern AVOID signal_error (const char *, Lisp_Object);
extern AVOID overflow_error (void);