"really fix bug in comterp stream traversal"
Brought to you by:
johnston
|
From: <ivt...@li...> - 2002-02-13 17:44:54
|
Patch: ivtools-011116-johnston-005
For: ivtools-1.0
Author: joh...@us...
Subject: really fix bug in comterp stream traversal
Requires:
This is an intermediate patch to ivtools-1.0. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- fix bug the proper way for comterp stream traversal via
NextFunc::execute_impl. It was actually leaving more than an extra
null-value on the stack, which confused the interpreter.
Index: ComTerp/strmfunc.c
diff -c ComTerp/strmfunc.c:1.2 ComTerp/strmfunc.c:1.3
*** ComTerp/strmfunc.c:1.2 Fri Nov 16 08:41:11 2001
--- src/ComTerp/strmfunc.c Fri Nov 16 10:00:15 2001
***************
*** 399,407 ****
if (comterp->stack_top().is_null() &&
comterp->stack_height()>inside_stackh) {
! /* sub-stream return null, zero it, and return null for this one */
val->stream_list()->clear();
streamv.stream_list()->clear();
return;
} else if (comterp->stack_height()==inside_stackh)
comterp->push_stack(ComValue::blankval());
--- 399,409 ----
if (comterp->stack_top().is_null() &&
comterp->stack_height()>inside_stackh) {
! /* sub-stream returnnull, zero it, and return null for this one */
val->stream_list()->clear();
streamv.stream_list()->clear();
+ while (comterp->stack_height()>outside_stackh) comterp->pop_stack();
+ comterp->push_stack(ComValue::nullval());
return;
} else if (comterp->stack_height()==inside_stackh)
comterp->push_stack(ComValue::blankval());
*** /dev/null Fri Nov 16 10:01:45 PST 2001
--- patches/ivtools-011116-johnston-005
*************** patches/ivtools-011116-johnston-005
*** 0 ****
--- 1 ----
+ ivtools-011116-johnston-005
|