Skip to content

Correctly determine bounds for predefined literals #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Capitalize function name
  • Loading branch information
Mandeep Singh Grang committed Aug 28, 2019
commit e6ada3e033aae6dd3e01bd628753c246ea793acf
6 changes: 3 additions & 3 deletions lib/Sema/SemaBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ namespace {
}

// Infer bounds for string literals.
BoundsExpr *inferBoundsForStringLiteral(Expr *E, StringLiteral *SL,
BoundsExpr *InferBoundsForStringLiteral(Expr *E, StringLiteral *SL,
CHKCBindTemporaryExpr *Binding) {
// Use the number of characters in the string (excluding the null
// terminator) to calcaulte size. Don't use the array type of the
Expand Down Expand Up @@ -918,7 +918,7 @@ namespace {
ArrLValue);
return ExpandToRange(Base, BE);
} else if (StringLiteral *SL = dyn_cast<StringLiteral>(SE)) {
return inferBoundsForStringLiteral(E, SL, Binding);
return InferBoundsForStringLiteral(E, SL, Binding);
} else
return CreateBoundsAlwaysUnknown();
}
Expand All @@ -929,7 +929,7 @@ namespace {
if (!SL)
return CreateBoundsAlwaysUnknown();
auto *Binding = new (Context) CHKCBindTemporaryExpr(E);
return inferBoundsForStringLiteral(E, SL, Binding);
return InferBoundsForStringLiteral(E, SL, Binding);
}
default:
return CreateBoundsAlwaysUnknown();
Expand Down