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
faa54e59
Commit
faa54e59
authored
Feb 03, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that CALL addr is always 20 bytes
parent
93ae7bb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
vm.go
vm/vm.go
+6
-5
No files found.
vm/vm.go
View file @
faa54e59
...
...
@@ -516,7 +516,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
case
BLOCKHASH
:
num
:=
stack
.
Pop
()
n
:=
U256
(
new
(
big
.
Int
)
.
Sub
(
self
.
env
.
BlockNumber
(),
ethutil
.
Big257
)
)
n
:=
new
(
big
.
Int
)
.
Sub
(
self
.
env
.
BlockNumber
(),
ethutil
.
Big257
)
if
num
.
Cmp
(
n
)
>
0
&&
num
.
Cmp
(
self
.
env
.
BlockNumber
())
<
0
{
stack
.
Push
(
ethutil
.
BigD
(
self
.
env
.
GetHash
(
num
.
Uint64
())))
}
else
{
...
...
@@ -681,8 +681,6 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
self
.
Dbg
.
SetCode
(
context
.
Code
)
}
case
CALL
,
CALLCODE
:
self
.
Endl
()
gas
:=
stack
.
Pop
()
// Pop gas and value of the stack.
value
,
addr
:=
stack
.
Popn
()
...
...
@@ -691,6 +689,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
// Pop return size and offset
retSize
,
retOffset
:=
stack
.
Popn
()
address
:=
ethutil
.
Address
(
addr
.
Bytes
())
self
.
Printf
(
" => %x"
,
address
)
.
Endl
()
// Get the arguments from the memory
args
:=
mem
.
Get
(
inOffset
.
Int64
(),
inSize
.
Int64
())
...
...
@@ -699,9 +700,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
err
error
)
if
op
==
CALLCODE
{
ret
,
err
=
self
.
env
.
CallCode
(
context
,
addr
.
Bytes
()
,
args
,
gas
,
price
,
value
)
ret
,
err
=
self
.
env
.
CallCode
(
context
,
addr
ess
,
args
,
gas
,
price
,
value
)
}
else
{
ret
,
err
=
self
.
env
.
Call
(
context
,
addr
.
Bytes
()
,
args
,
gas
,
price
,
value
)
ret
,
err
=
self
.
env
.
Call
(
context
,
addr
ess
,
args
,
gas
,
price
,
value
)
}
if
err
!=
nil
{
...
...
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