Now the compiler tracks code that has no observable effect.
This commit is contained in:
@@ -605,6 +605,12 @@ void OpAssign (const GenDesc* Gen, ExprDesc* Expr, const char* Op)
|
||||
/* Normal straight 'op=' */
|
||||
OpAssignArithmetic (Gen, Expr, Op);
|
||||
}
|
||||
|
||||
/* Expression has had side effects */
|
||||
Expr->Flags |= E_SIDE_EFFECTS;
|
||||
|
||||
/* Propagate viral flags */
|
||||
ED_PropagateFrom (Expr, &Expr2);
|
||||
}
|
||||
|
||||
|
||||
@@ -725,4 +731,10 @@ void OpAddSubAssign (const GenDesc* Gen, ExprDesc *Expr, const char* Op)
|
||||
|
||||
/* Expression is an rvalue in the primary now */
|
||||
ED_FinalizeRValLoad (Expr);
|
||||
|
||||
/* Expression has had side effects */
|
||||
Expr->Flags |= E_SIDE_EFFECTS;
|
||||
|
||||
/* Propagate viral flags */
|
||||
ED_PropagateFrom (Expr, &Expr2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user