diff options
| author | bellard <bellard> | 2002-01-26 19:13:31 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2002-01-26 19:13:31 +0000 |
| commit | 5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed (patch) | |
| tree | b0ac24d3c6192b059b9160f8bcd66ce722e4c3a0 | |
| parent | 2d948c76106d40bb7a7060bbc71e04abf4562d5e (diff) | |
| download | tinycc-5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed.tar.gz tinycc-5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed.tar.bz2 | |
bound check fix
| -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 == '-') { |
