Make -release only disable bounds checking in non-@safe code.

This commit is contained in:
David Nadlinger
2013-06-17 13:31:21 +02:00
parent 1215ffacd3
commit 235bb94878
9 changed files with 42 additions and 17 deletions
+3 -3
View File
@@ -1609,12 +1609,12 @@ DValue* IndexExp::toElem(IRState* p)
arrptr = DtoGEP1(l->getRVal(),r->getRVal());
}
else if (e1type->ty == Tsarray) {
if(global.params.useArrayBounds)
if (gIR->emitArrayBoundsChecks())
DtoArrayBoundsCheck(loc, l, r);
arrptr = DtoGEP(l->getRVal(), zero, r->getRVal());
}
else if (e1type->ty == Tarray) {
if(global.params.useArrayBounds)
if (gIR->emitArrayBoundsChecks())
DtoArrayBoundsCheck(loc, l, r);
arrptr = DtoArrayPtr(l);
arrptr = DtoGEP1(arrptr,r->getRVal());
@@ -1672,7 +1672,7 @@ DValue* SliceExp::toElem(IRState* p)
LLValue* vlo = lo->getRVal();
LLValue* vup = up->getRVal();
if(global.params.useArrayBounds)
if (gIR->emitArrayBoundsChecks())
DtoArrayBoundsCheck(loc, e, up, lo);
// offset by lower