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
bdaa4351
Commit
bdaa4351
authored
Dec 21, 2016
by
Valentin Wüstholz
Committed by
Felix Lange
Dec 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/disasm: fix off-by-one error and improve error handling (#3482)
parent
9a51f5c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
main.go
cmd/disasm/main.go
+7
-2
No files found.
cmd/disasm/main.go
View file @
bdaa4351
...
@@ -21,8 +21,9 @@ import (
...
@@ -21,8 +21,9 @@ import (
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"os"
"os"
"encoding/hex"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
)
)
...
@@ -32,7 +33,11 @@ func main() {
...
@@ -32,7 +33,11 @@ func main() {
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
code
=
common
.
Hex2Bytes
(
string
(
code
[
:
len
(
code
)
-
1
]))
code
,
err
=
hex
.
DecodeString
(
strings
.
TrimSpace
(
string
(
code
[
:
])))
if
err
!=
nil
{
fmt
.
Printf
(
"Error: %v
\n
"
,
err
)
return
}
fmt
.
Printf
(
"%x
\n
"
,
code
)
fmt
.
Printf
(
"%x
\n
"
,
code
)
for
pc
:=
uint64
(
0
);
pc
<
uint64
(
len
(
code
));
pc
++
{
for
pc
:=
uint64
(
0
);
pc
<
uint64
(
len
(
code
));
pc
++
{
...
...
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