mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-19 13:45:21 +02:00
Enable array bounds check and emit them in IndexExp.
This commit is contained in:
@@ -1008,9 +1008,13 @@ DValue* IndexExp::toElem(IRState* p)
|
||||
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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user