mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00
Add inbounds where possible
This commit is contained in:
parent
53cd715530
commit
eedde0ab16
3 changed files with 61 additions and 5 deletions
|
@ -115,7 +115,7 @@ DValue *emitPointerOffset(Loc loc, DValue *base, Expression *offset,
|
|||
if (!llResult) {
|
||||
if (negateOffset)
|
||||
llOffset = gIR->ir->CreateNeg(llOffset);
|
||||
llResult = DtoGEP1(llBase, llOffset, false);
|
||||
llResult = DtoGEP1(llBase, llOffset, /* inBounds = */ true);
|
||||
}
|
||||
|
||||
return new DImValue(resultType, DtoBitCast(llResult, DtoType(resultType)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue