fixed a bug in compile_do()

This commit is contained in:
hyung-hwan 2022-08-01 06:31:33 +00:00
parent 1bf908e6ba
commit e8acc7cd5b
3 changed files with 12 additions and 17 deletions

View File

@ -1911,8 +1911,8 @@ static int compile_do (hcl_t* hcl, hcl_cnode_t* src)
HCL_ASSERT (hcl, HCL_CNODE_IS_CONS(src)); HCL_ASSERT (hcl, HCL_CNODE_IS_CONS(src));
HCL_ASSERT (hcl, HCL_CNODE_IS_SYMBOL_SYNCODED(HCL_CNODE_CONS_CAR(src), HCL_SYNCODE_DO)); HCL_ASSERT (hcl, HCL_CNODE_IS_SYMBOL_SYNCODED(HCL_CNODE_CONS_CAR(src), HCL_SYNCODE_DO));
cmd = HCL_CNODE_CONS_CDR(src); cmd = HCL_CNODE_CONS_CAR(src); /* do itself */
obj = HCL_CNODE_CONS_CDR(src); obj = HCL_CNODE_CONS_CDR(src); /* expression list after it */
if (!obj) if (!obj)
{ {

View File

@ -422,7 +422,6 @@ static HCL_INLINE int close_input (hcl_t* hcl, hcl_ioinarg_t* arg)
return 0; return 0;
} }
static HCL_INLINE int read_input (hcl_t* hcl, hcl_ioinarg_t* arg) static HCL_INLINE int read_input (hcl_t* hcl, hcl_ioinarg_t* arg)
{ {
worker_hcl_xtn_t* xtn = (worker_hcl_xtn_t*)hcl_getxtn(hcl); worker_hcl_xtn_t* xtn = (worker_hcl_xtn_t*)hcl_getxtn(hcl);
@ -494,7 +493,8 @@ static HCL_INLINE int read_input (hcl_t* hcl, hcl_ioinarg_t* arg)
x = read(bb->fd, &bb->buf[bb->len], HCL_COUNTOF(bb->buf) - bb->len); x = read(bb->fd, &bb->buf[bb->len], HCL_COUNTOF(bb->buf) - bb->len);
if (x <= -1) if (x <= -1)
{ {
hcl_seterrnum (hcl, HCL_EIOERR); /* TODO: if (errno == EINTR) retry? */
hcl_seterrwithsyserr (hcl, 0, errno);
return -1; return -1;
} }
@ -515,7 +515,7 @@ static HCL_INLINE int read_input (hcl_t* hcl, hcl_ioinarg_t* arg)
#endif #endif
remlen = bb->len - bcslen; remlen = bb->len - bcslen;
if (remlen > 0) memmove (bb->buf, &bb->buf[bcslen], remlen); if (remlen > 0) HCL_MEMMOVE (bb->buf, &bb->buf[bcslen], remlen);
bb->len = remlen; bb->len = remlen;
arg->xlen = ucslen; arg->xlen = ucslen;

View File

@ -3715,13 +3715,8 @@ static int feed_from_included (hcl_t* hcl)
if (hcl->c->curinp->xlen <= 0) if (hcl->c->curinp->xlen <= 0)
{ {
/* got EOF from an included stream */ /* got EOF from an included stream */
#if 0
x = feed_char(hcl, HCL_OOCI_EOF); /* TODO: or call feed_end_include? */
if (x <= -1) return -1;
#else
feed_end_include (hcl); feed_end_include (hcl);
continue; continue;
#endif
} }
hcl->c->curinp->b.pos = 0; hcl->c->curinp->b.pos = 0;