Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
438:3c133dd1eda3 | 439:47b64d06eb9f |
---|---|
1006 LLValue* arrptr = 0; | 1006 LLValue* arrptr = 0; |
1007 if (e1type->ty == Tpointer) { | 1007 if (e1type->ty == Tpointer) { |
1008 arrptr = DtoGEP1(l->getRVal(),r->getRVal()); | 1008 arrptr = DtoGEP1(l->getRVal(),r->getRVal()); |
1009 } | 1009 } |
1010 else if (e1type->ty == Tsarray) { | 1010 else if (e1type->ty == Tsarray) { |
1011 if(global.params.useArrayBounds) | |
1012 DtoArrayBoundsCheck(loc, l, r); | |
1011 arrptr = DtoGEP(l->getRVal(), zero, r->getRVal()); | 1013 arrptr = DtoGEP(l->getRVal(), zero, r->getRVal()); |
1012 } | 1014 } |
1013 else if (e1type->ty == Tarray) { | 1015 else if (e1type->ty == Tarray) { |
1016 if(global.params.useArrayBounds) | |
1017 DtoArrayBoundsCheck(loc, l, r); | |
1014 arrptr = DtoArrayPtr(l); | 1018 arrptr = DtoArrayPtr(l); |
1015 arrptr = DtoGEP1(arrptr,r->getRVal()); | 1019 arrptr = DtoGEP1(arrptr,r->getRVal()); |
1016 } | 1020 } |
1017 else if (e1type->ty == Taarray) { | 1021 else if (e1type->ty == Taarray) { |
1018 return DtoAAIndex(loc, type, l, r); | 1022 return DtoAAIndex(loc, type, l, r); |