diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-24 00:56:31 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-24 00:56:31 +0000 |
| commit | 9ef415edf27215b97b89782c06a68d78bff841a6 (patch) | |
| tree | 2690afb6531fb4bbddd48afa5cd7e09484794983 /clang/lib | |
| parent | a3d375845e4985b3bc33d84651afeec4a5a89049 (diff) | |
| download | bcm5719-llvm-9ef415edf27215b97b89782c06a68d78bff841a6.tar.gz bcm5719-llvm-9ef415edf27215b97b89782c06a68d78bff841a6.zip | |
RegionStore: revert to the default value approach for array initialization.
llvm-svn: 74043
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 77f5b7cb39b..ab60ff32ada 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -1127,15 +1127,12 @@ const GRState *RegionStoreManager::BindArray(const GRState *state, state = Bind(state, ValMgr.makeLoc(ER), *VI); } - // If the init list is shorter than the array length, bind the rest elements - // to 0. - if (ElementTy->isIntegerType()) { - while (i < Size) { - SVal Idx = ValMgr.makeIntVal(i); - ElementRegion* ER = MRMgr.getElementRegion(ElementTy, Idx,R,getContext()); + // If the init list is shorter than the array length, set the array default + // value. + if (i < Size) { + if (ElementTy->isIntegerType()) { SVal V = ValMgr.makeZeroVal(ElementTy); - state = Bind(state, ValMgr.makeLoc(ER), V); - ++i; + state = setDefaultValue(state, R, V); } } |

