mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-30 09:10:19 +02:00
Make -release only disable bounds checking in non-@safe code.
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user