Merge pull request #11071 from ethereum/fixCRInSourceRefFor

Fix handling of carriage return.
This commit is contained in:
chriseth
2021-03-09 17:52:34 +01:00
committed by GitHub
7 changed files with 16 additions and 3 deletions
+1
View File
@@ -9,6 +9,7 @@ Compiler Features:
Bugfixes:
* Error Reporter: Fix handling of carriage return.
* SMTChecker: Fix internal error on ``FixedBytes`` constant initialized with string literal.
* SMTChecker: Fix internal error on array slices.
* SMTChecker: Fix internal error on calling public getter on a state variable of type array (possibly nested) of structs.
+4 -3
View File
@@ -19,6 +19,7 @@
#include <liblangutil/CharStream.h>
#include <liblangutil/Exceptions.h>
#include <algorithm>
#include <cmath>
#include <iomanip>
@@ -87,7 +88,7 @@ SourceReference SourceReferenceExtractor::extract(SourceLocation const* _locatio
line = line.substr(
static_cast<size_t>(max(0, start.column - 35)),
static_cast<size_t>(min(start.column, 35)) + static_cast<size_t>(
min(locationLength + 35,len - start.column)
min(locationLength + 35, len - start.column)
)
);
if (start.column + locationLength + 35 < len)
@@ -106,7 +107,7 @@ SourceReference SourceReferenceExtractor::extract(SourceLocation const* _locatio
interest,
isMultiline,
line,
start.column,
end.column,
min(start.column, static_cast<int>(line.length())),
min(end.column, static_cast<int>(line.length()))
};
}
+2
View File
@@ -6,6 +6,8 @@ ERROR_LOG="$(mktemp -t check_style_XXXXXX.log)"
EXCLUDE_FILES=(
"libsolutil/picosha2.h"
"test/cmdlineTests/strict_asm_only_cr/input.yul"
"test/cmdlineTests/strict_asm_only_cr/err"
"test/libsolutil/UTF8.cpp"
"test/libsolidity/syntaxTests/license/license_cr_endings.sol"
"test/libsolidity/syntaxTests/license/license_crlf_endings.sol"
@@ -0,0 +1 @@
--strict-assembly
+6
View File
@@ -0,0 +1,6 @@
Warning: Yul is still experimental. Please use the output with care.
Error: Expected keyword "object".
--> strict_asm_only_cr/input.yul:1:2:
|
1 |
| ^
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@