[PATCH] D51867: [Diagnostics] Add error handling to FormatDiagnostic()

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 18:35:06 PDT 2018


vsapsai added a comment.

It seems like there are too many asserts and they are too specific, they seem to be aimed at specific potential bugs. What about asserts that make sure we maintain some invariants? For example, check `DiagStr < DiagEnd` once in a loop instead of every place we increment `DiagStr`. Do you think it should catch the same problems but maybe a little bit later?

My suggestion is based on assumption that `FormatDiagnostic` works only with predefined format strings and not with strings provided by compiler users (arguments can be provided by users but not format strings).

I won't be able for some time to check the review again, so it's OK not to wait for my approval.


Repository:
  rC Clang

https://reviews.llvm.org/D51867





More information about the cfe-commits mailing list