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
ca6e3f6d
Commit
ca6e3f6d
authored
Apr 26, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notify of changes
parent
d3a159ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
vm.go
ethchain/vm.go
+4
-5
No files found.
ethchain/vm.go
View file @
ca6e3f6d
...
@@ -56,8 +56,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -56,8 +56,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
// Recover from any require exception
// Recover from any require exception
defer
func
()
{
defer
func
()
{
if
r
:=
recover
();
r
!=
nil
/*&& isRequireError*/
{
if
r
:=
recover
();
r
!=
nil
/*&& isRequireError*/
{
fmt
.
Println
(
r
)
ret
=
closure
.
Return
(
nil
)
ret
=
closure
.
Return
(
nil
)
err
=
fmt
.
Errorf
(
"%v"
,
r
)
err
=
fmt
.
Errorf
(
"%v"
,
r
)
fmt
.
Println
(
"vm err"
,
err
)
fmt
.
Println
(
"vm err"
,
err
)
...
@@ -158,7 +156,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -158,7 +156,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
x
,
y
:=
stack
.
Popn
()
x
,
y
:=
stack
.
Popn
()
// (x + y) % 2 ** 256
// (x + y) % 2 ** 256
base
.
Add
(
x
,
y
)
base
.
Add
(
x
,
y
)
fmt
.
Println
(
x
,
y
,
base
)
// Pop result back on the stack
// Pop result back on the stack
stack
.
Push
(
base
)
stack
.
Push
(
base
)
case
oSUB
:
case
oSUB
:
...
@@ -321,7 +318,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -321,7 +318,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
require
(
1
)
require
(
1
)
offset
:=
stack
.
Pop
()
.
Int64
()
offset
:=
stack
.
Pop
()
.
Int64
()
val
:=
closure
.
Args
[
offset
:
offset
+
32
]
val
:=
closure
.
Args
[
offset
:
offset
+
32
]
fmt
.
Println
(
ethutil
.
BigD
(
val
))
stack
.
Push
(
ethutil
.
BigD
(
val
))
stack
.
Push
(
ethutil
.
BigD
(
val
))
case
oCALLDATASIZE
:
case
oCALLDATASIZE
:
...
@@ -394,7 +390,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -394,7 +390,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
require
(
1
)
require
(
1
)
loc
:=
stack
.
Pop
()
loc
:=
stack
.
Pop
()
val
:=
closure
.
GetMem
(
loc
)
val
:=
closure
.
GetMem
(
loc
)
fmt
.
Printf
(
"load %x = %v
\n
"
,
loc
.
Bytes
(),
val
.
BigInt
())
stack
.
Push
(
val
.
BigInt
())
stack
.
Push
(
val
.
BigInt
())
case
oSSTORE
:
case
oSSTORE
:
require
(
2
)
require
(
2
)
...
@@ -452,8 +447,12 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -452,8 +447,12 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
ret
,
err
:=
closure
.
Call
(
vm
,
args
,
hook
)
ret
,
err
:=
closure
.
Call
(
vm
,
args
,
hook
)
if
err
!=
nil
{
if
err
!=
nil
{
stack
.
Push
(
ethutil
.
BigFalse
)
stack
.
Push
(
ethutil
.
BigFalse
)
// Reset the changes applied this object
//contract.State().Reset()
}
else
{
}
else
{
stack
.
Push
(
ethutil
.
BigTrue
)
stack
.
Push
(
ethutil
.
BigTrue
)
// Notify of the changes
vm
.
stateManager
.
Changed
(
contract
)
}
}
mem
.
Set
(
retOffset
.
Int64
(),
retSize
.
Int64
(),
ret
)
mem
.
Set
(
retOffset
.
Int64
(),
retSize
.
Int64
(),
ret
)
...
...
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