case TYP_INT:
/* Fold constant INT unary operator */
- assert(op1->gtIntCon.ImmedValCanBeFolded(this, tree->OperGet()));
+
+ if (!op1->gtIntCon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
+
i1 = (int)op1->gtIntCon.gtIconVal;
// If we fold a unary oper, then the folded constant
/* Fold constant LONG unary operator */
- assert(op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()));
+ if (!op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
+
lval1 = op1->gtIntConCommon.LngValue();
switch (tree->gtOper)
//
assert(!varTypeIsGC(op1->gtType) && !varTypeIsGC(op2->gtType));
- assert(op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()));
- assert(op2->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()));
+ if (!op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
+
+ if (!op2->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
i1 = op1->gtIntConCommon.IconValue();
i2 = op2->gtIntConCommon.IconValue();
//
assert((op2->gtType == TYP_LONG) || (op2->gtType == TYP_INT));
- assert(op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()));
- assert(op2->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()));
+ if (!op1->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
+
+ if (!op2->gtIntConCommon.ImmedValCanBeFolded(this, tree->OperGet()))
+ {
+ return tree;
+ }
lval1 = op1->gtIntConCommon.LngValue();