Merge pull request #11627 from ethereum/allowEmptyFileName

Include locations with empty source name.
This commit is contained in:
chriseth 2021-07-07 12:52:49 +02:00 committed by GitHub
commit 566537835b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ Bugfixes:
* Code Generator: Fix crash when passing an empty string literal to ``bytes.concat()``. * Code Generator: Fix crash when passing an empty string literal to ``bytes.concat()``.
* Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays. * Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays.
* Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to ``bytes.concat()`` by disallowing such literals. * Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to ``bytes.concat()`` by disallowing such literals.
* Standard JSON: Include source location for errors in files with empty name.
* Type Checker: Fix internal error and prevent static calls to unimplemented modifiers. * Type Checker: Fix internal error and prevent static calls to unimplemented modifiers.
* Yul Code Generator: Fix internal compiler error when using a long literal with bitwise negation. * Yul Code Generator: Fix internal compiler error when using a long literal with bitwise negation.
* Yul Code Generator: Fix source location references for calls to builtin functions. * Yul Code Generator: Fix source location references for calls to builtin functions.

View File

@ -83,7 +83,7 @@ Json::Value formatFatalError(string const& _type, string const& _message)
Json::Value formatSourceLocation(SourceLocation const* location) Json::Value formatSourceLocation(SourceLocation const* location)
{ {
Json::Value sourceLocation; Json::Value sourceLocation;
if (location && location->source && !location->source->name().empty()) if (location && location->source)
{ {
sourceLocation["file"] = location->source->name(); sourceLocation["file"] = location->source->name();
sourceLocation["start"] = location->start; sourceLocation["start"] = location->start;

View File

@ -1,3 +1,3 @@
{"errors":[{"component":"general","errorCode":"2904","formattedMessage":"DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\"). {"errors":[{"component":"general","errorCode":"2904","formattedMessage":"DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\").
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{"":{"id":0}}} ","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","sourceLocation":{"end":79,"file":"","start":59},"type":"DeclarationError"}],"sources":{"":{"id":0}}}