Changeset 1081 for trunk


Ignore:
Timestamp:
Oct 30, 2014 4:07:03 PM (5 years ago)
Author:
pbelotti
Message:

compare right pointer, not their ExprCopy? or ExprClone?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/expression/expression.cpp

    r873 r1081  
    7272  // same code, check arguments
    7373
    74   if (c0 >= COU_EXPRUNARY) { // both are exprUnary's
    75 
    76     exprUnary *ne0 = dynamic_cast <exprUnary *> (this);
    77     exprUnary *ne1 = dynamic_cast <exprUnary *> (&e1);
     74  if (c0 >= COU_EXPRUNARY) { // both are exprUnary's. COU_EXPRUNARY > COU_EXPROP, so if this is run then the next is not
     75
     76    exprUnary *ne0 = dynamic_cast <exprUnary *> (const_cast <expression *> (this->Original()));
     77    exprUnary *ne1 = dynamic_cast <exprUnary *> (const_cast <expression *> (e1.Original()));
    7878
    7979    return ne0 -> compare (*ne1);
     
    8282  if (c0 >= COU_EXPROP) { // both are exprOp's
    8383
    84     exprOp *ne0 = dynamic_cast <exprOp *> (this);
    85     exprOp *ne1 = dynamic_cast <exprOp *> (&e1);
     84    exprOp *ne0 = dynamic_cast <exprOp *> (const_cast <expression *> (this->Original()));
     85    exprOp *ne1 = dynamic_cast <exprOp *> (const_cast <expression *> (e1.Original()));
    8686
    8787    return ne0 -> compare (*ne1);
Note: See TracChangeset for help on using the changeset viewer.