aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2002-01-26 19:13:31 +0000
committerbellard <bellard>2002-01-26 19:13:31 +0000
commit5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed (patch)
treeb0ac24d3c6192b059b9160f8bcd66ce722e4c3a0
parent2d948c76106d40bb7a7060bbc71e04abf4562d5e (diff)
downloadtinycc-5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed.tar.gz
tinycc-5bf9559e9e91fed9a8ab9d7d34d97eb94c7272ed.tar.bz2
bound check fix
-rw-r--r--tcc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tcc.c b/tcc.c
index 520a62b..7516211 100644
--- a/tcc.c
+++ b/tcc.c
@@ -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 == '-') {