Fix misc bad-syntax crashes, bug1557-1560.

This commit is contained in:
Wilson Snyder
2019-10-16 20:05:29 -04:00
parent 46ab907f6a
commit 6081c262f2
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -377,8 +377,8 @@ string FileLine::warnContext(bool secondary) const {
out += sourceLine+"\n";
out += string((firstColumn()-1), ' ')+'^';
// Can't use UASSERT_OBJ used in warnings already inside the error end handler
UASSERT_STATIC(lastColumn() >= firstColumn(), "Column numbers backwards");
if (lastColumn() != firstColumn()) {
if (lastColumn() > firstColumn()) {
// Note lastColumn() can be <= firstColumn() in some weird preproc expansions
out += string((lastColumn()-firstColumn()-1), '~');
}
out += "\n";