diff options
author | Devang Patel <dpatel@apple.com> | 2009-09-05 00:34:14 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-09-05 00:34:14 +0000 |
commit | bd1d6a8ce1197de640df52e1da2e63e8ce8d8705 (patch) | |
tree | be1ac749301478a57de59cd33a3a1ec935262ee5 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 905cf5e0bd4feaec00c45f44893afbbd1f02a149 (diff) |
Detect VLAs.
Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 555ef9e1b0..cd05f7124d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3981,7 +3981,11 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // Don't handle byval struct arguments or VLAs, for example. if (!AI) return 0; - int FI = FuncInfo.StaticAllocaMap[AI]; + DenseMap<const AllocaInst*, int>::iterator SI = + FuncInfo.StaticAllocaMap.find(AI); + if (SI == FuncInfo.StaticAllocaMap.end()) + return 0; // VLAs. + int FI = SI->second; DW->RecordVariable(cast<MDNode>(Variable), FI); return 0; } |