aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/DeclSpec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r--lib/Parse/DeclSpec.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp
index 2a765d2124..f3ff0c6379 100644
--- a/lib/Parse/DeclSpec.cpp
+++ b/lib/Parse/DeclSpec.cpp
@@ -35,6 +35,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic,
bool hasExceptionSpec,
bool hasAnyExceptionSpec,
ActionBase::TypeTy **Exceptions,
+ SourceRange *ExceptionRanges,
unsigned NumExceptions,
SourceLocation Loc,
Declarator &TheDeclarator) {
@@ -72,9 +73,11 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic,
}
// new[] an exception array if needed
if (NumExceptions) {
- I.Fun.Exceptions = new ActionBase::TypeTy*[NumExceptions];
- memcpy(I.Fun.Exceptions, Exceptions,
- sizeof(ActionBase::TypeTy*)*NumExceptions);
+ I.Fun.Exceptions = new DeclaratorChunk::TypeAndRange[NumExceptions];
+ for (unsigned i = 0; i != NumExceptions; ++i) {
+ I.Fun.Exceptions[i].Ty = Exceptions[i];
+ I.Fun.Exceptions[i].Range = ExceptionRanges[i];
+ }
}
return I;
}