Skip to content

Commit ad9874a

Browse files
Tweak matt's fix to pass two-file test case
1 parent 02c0b3b commit ad9874a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

clang/lib/3C/DeclRewriter.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,14 @@ FunctionDeclBuilder::buildDeclVar(PVConstraint *IntCV, PVConstraint *ExtCV,
735735
// just fall back to reconstructing the declaration from the PVConstraint.
736736
ParmVarDecl *PVD = dyn_cast<ParmVarDecl>(Decl);
737737
if (PVD) {
738-
Type = getSourceText(PVD->getSourceRange(), *Context);
739-
if (!Type.empty()) {
740-
// Great, we got the original source including any itype and bounds.
741-
IType = "";
742-
return;
738+
SourceRange Range = PVD->getSourceRange();
739+
if (Range.isValid()) {
740+
Type = getSourceText(Range, *Context);
741+
if (!Type.empty()) {
742+
// Great, we got the original source including any itype and bounds.
743+
IType = "";
744+
return;
745+
}
743746
}
744747
// Otherwise, reconstruct the name and type, and reuse the code below for
745748
// the itype and bounds.

0 commit comments

Comments
 (0)