aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1998-09-22 10:33:09 +0000
committerKenichi Handa1998-09-22 10:33:09 +0000
commit519bf1461a882f40fa8e4e12cb161e1ffbde4b8b (patch)
tree9ad17db29d4cb3a3828975b083d2117c6916d2a4
parent703dc2a8957281368c63fd30e73b403db2dc14f2 (diff)
downloademacs-519bf1461a882f40fa8e4e12cb161e1ffbde4b8b.tar.gz
emacs-519bf1461a882f40fa8e4e12cb161e1ffbde4b8b.zip
(ccl_driver): Report correct CCL program counter on error.
-rw-r--r--src/ccl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ccl.c b/src/ccl.c
index 157992de0a7..c724405e16c 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -746,6 +746,8 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
746 int stack_idx = 0; 746 int stack_idx = 0;
747 /* For the moment, we only support depth 256 of stack. */ 747 /* For the moment, we only support depth 256 of stack. */
748 struct ccl_prog_stack ccl_prog_stack_struct[256]; 748 struct ccl_prog_stack ccl_prog_stack_struct[256];
749 /* Instruction counter of the current CCL code. */
750 int this_ic;
749 751
750 if (ic >= ccl->eof_ic) 752 if (ic >= ccl->eof_ic)
751 ic = CCL_HEADER_MAIN; 753 ic = CCL_HEADER_MAIN;
@@ -778,6 +780,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
778 break; 780 break;
779 } 781 }
780 782
783 this_ic = ic;
781 code = XINT (ccl_prog[ic]); ic++; 784 code = XINT (ccl_prog[ic]); ic++;
782 field1 = code >> 8; 785 field1 = code >> 8;
783 field2 = (code & 0xFF) >> 5; 786 field2 = (code & 0xFF) >> 5;
@@ -1552,7 +1555,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1552 { 1555 {
1553 case CCL_STAT_INVALID_CMD: 1556 case CCL_STAT_INVALID_CMD:
1554 sprintf(msg, "\nCCL: Invalid command %x (ccl_code = %x) at %d.", 1557 sprintf(msg, "\nCCL: Invalid command %x (ccl_code = %x) at %d.",
1555 code & 0x1F, code, ic); 1558 code & 0x1F, code, this_ic);
1556#ifdef CCL_DEBUG 1559#ifdef CCL_DEBUG
1557 { 1560 {
1558 int i = ccl_backtrace_idx - 1; 1561 int i = ccl_backtrace_idx - 1;