Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
49aa8a63
Unverified
Commit
49aa8a63
authored
2 years ago
by
Henry
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common/compiler: json unmarshalling error checks (#25449)
complier/solidity:add json.Unmarshal err check
parent
fea569f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
solidity.go
common/compiler/solidity.go
+7
-4
No files found.
common/compiler/solidity.go
View file @
49aa8a63
...
...
@@ -66,13 +66,16 @@ func ParseCombinedJSON(combinedJSON []byte, source string, languageVersion strin
contracts
:=
make
(
map
[
string
]
*
Contract
)
for
name
,
info
:=
range
output
.
Contracts
{
// Parse the individual compilation results.
var
abi
interface
{}
var
abi
,
userdoc
,
devdoc
interface
{}
if
err
:=
json
.
Unmarshal
([]
byte
(
info
.
Abi
),
&
abi
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"solc: error reading abi definition (%v)"
,
err
)
}
var
userdoc
,
devdoc
interface
{}
json
.
Unmarshal
([]
byte
(
info
.
Userdoc
),
&
userdoc
)
json
.
Unmarshal
([]
byte
(
info
.
Devdoc
),
&
devdoc
)
if
err
:=
json
.
Unmarshal
([]
byte
(
info
.
Userdoc
),
&
userdoc
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"solc: error reading userdoc definition (%v)"
,
err
)
}
if
err
:=
json
.
Unmarshal
([]
byte
(
info
.
Devdoc
),
&
devdoc
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"solc: error reading devdoc definition (%v)"
,
err
)
}
contracts
[
name
]
=
&
Contract
{
Code
:
"0x"
+
info
.
Bin
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment