comparison src/ccl.c @ 23303:fb38954a02d3

(ccl_driver): Report correct CCL program counter on error.
author Kenichi Handa <handa@m17n.org>
date Tue, 22 Sep 1998 10:33:09 +0000
parents b4656367043f
children 49c7e979c16c
comparison
equal deleted inserted replaced
23302:dcff2a4b6cb4 23303:fb38954a02d3
744 int jump_address; 744 int jump_address;
745 int i, j, op; 745 int i, j, op;
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;
752 754
753 if (ccl->buf_magnification ==0) /* We can't produce any bytes. */ 755 if (ccl->buf_magnification ==0) /* We can't produce any bytes. */
776 src = source + src_bytes; 778 src = source + src_bytes;
777 ccl->status = CCL_STAT_QUIT; 779 ccl->status = CCL_STAT_QUIT;
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;
784 787
785 #define rrr field2 788 #define rrr field2
1550 1553
1551 switch (ccl->status) 1554 switch (ccl->status)
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;
1559 int j; 1562 int j;
1560 1563