On 03/21, Oleg Nesterov wrote:
>
> I don't really understand this code, but it seems that the isNumericalTuple()
> simplification in realeval() is not right. At least the "patch" below seems
> to fix a problem.
Yes, I think this is true... So unless you are going to change the "propogate"
paths, I _think_ that the fix should do something like below. Note also that
both isBoxPrim1 and "xtended" cases have the same problem,
process = 0,0 : sin;
process = 0,0 : mem;
but I am sure you understand this much better than me ;)
and I am not sure about isBoxWire()...
Oleg.
--- a/compiler/evaluate/eval.cpp
+++ b/compiler/evaluate/eval.cpp
@@ -306,6 +306,17 @@ static bool isNumericalTuple(Tree box, siglist& L)
* @return a block diagram in normal form
*/
+static bool xxx(const siglist &lsig, Tree a2)
+{
+ xtended* xxt = (xtended*) getUserData(a2);
+ int lsize = lsig.size();
+
+ return (isBoxWire(a2) /* && ????? */) ||
+ (xxt && lsize == xxt->arity()) ||
+ (isBoxPrim1(a2) && lsize == 1) ||
+ (isBoxPrim2(a2) && lsize == 2);
+}
+
static Tree realeval (Tree exp, Tree visited, Tree localValEnv)
{
//Tree def;
@@ -342,10 +353,9 @@ static Tree realeval (Tree exp, Tree visited, Tree
localValEnv)
} else if (isBoxSeq(exp, e1, e2)) {
Tree a1 = eval(e1, visited, localValEnv);
Tree a2 = eval(e2, visited, localValEnv);
- xtended* xxt = (xtended*) getUserData(a2);
siglist lsig;
// try a numerical simplification of expressions of type 2,3:+
- if (isNumericalTuple(a1,lsig) && (xxt || isBoxWire(a2) ||
isBoxPrim1(a2) || isBoxPrim2(a2))) {
+ if (isNumericalTuple(a1,lsig) && xxx(lsig, a2)) {
Tree lres = boxPropagateSig(gGlobal->nil, a2, lsig);
if ( isList(lres) && isNil(tl(lres)) ) {
Tree r = simplify(hd(lres));
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users