Mercurial > projects > ldc
diff gen/toir.cpp @ 439:47b64d06eb9f
Enable array bounds check and emit them in IndexExp.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 30 Jul 2008 18:38:56 +0200 |
parents | 74101be2a553 |
children | d8dc221d3db7 |
line wrap: on
line diff
--- a/gen/toir.cpp Wed Jul 30 16:48:35 2008 +0200 +++ b/gen/toir.cpp Wed Jul 30 18:38:56 2008 +0200 @@ -1008,9 +1008,13 @@ arrptr = DtoGEP1(l->getRVal(),r->getRVal()); } else if (e1type->ty == Tsarray) { + if(global.params.useArrayBounds) + DtoArrayBoundsCheck(loc, l, r); arrptr = DtoGEP(l->getRVal(), zero, r->getRVal()); } else if (e1type->ty == Tarray) { + if(global.params.useArrayBounds) + DtoArrayBoundsCheck(loc, l, r); arrptr = DtoArrayPtr(l); arrptr = DtoGEP1(arrptr,r->getRVal()); }