diff options
| -rw-r--r-- | tcc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3101,7 +3101,9 @@ void gen_op(int op) /* XXX: cast to int ? (long long case) */ vpushi(pointed_size(vtop[-1].t)); gen_op('*'); - if (do_bounds_check) { + /* if evaluating constant expression, no code should be + generated, so no bound check */ + if (do_bounds_check && !const_wanted) { /* if bounded pointers, we generate a special code to test bounds */ if (op == '-') { |
