Only when peephole optimization is on

This commit is contained in:
Dale Weiler 2013-10-04 07:02:06 -04:00
parent 2cf5046d38
commit ffdd6df828

2
ast.c
View file

@ -454,7 +454,7 @@ ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
* Try to fold away superfluous binary operations, such as:
* A * 1, a + 0, etc.
*/
if ((fold = (ast_binary*)fold_superfluous(left, right, op))) {
if (OPTS_OPTIMIZATION(OPTIM_PEEPHOLE) && (fold = (ast_binary*)fold_superfluous(left, right, op))) {
ast_binary_delete(self);
return fold;
}