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
3ea8c730
Commit
3ea8c730
authored
Mar 27, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PUSH gas fix
parent
df648cbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
21 deletions
+5
-21
gas.go
core/vm/gas.go
+4
-4
vm.go
core/vm/vm.go
+1
-17
No files found.
core/vm/gas.go
View file @
3ea8c730
...
...
@@ -61,8 +61,8 @@ func baseCheck(op OpCode, stack *stack, gas *big.Int) error {
if
op
>=
PUSH1
&&
op
<=
PUSH32
{
op
=
PUSH1
}
if
op
>=
SWAP1
&&
op
<=
SWA
P16
{
op
=
SWA
P1
if
op
>=
DUP1
&&
op
<=
DU
P16
{
op
=
DU
P1
}
if
r
,
ok
:=
_baseCheck
[
op
];
ok
{
...
...
@@ -71,7 +71,7 @@ func baseCheck(op OpCode, stack *stack, gas *big.Int) error {
return
err
}
if
r
.
stackPush
&&
len
(
stack
.
data
)
-
r
.
stackPop
==
1024
{
if
r
.
stackPush
&&
len
(
stack
.
data
)
-
r
.
stackPop
+
1
>
1024
{
return
fmt
.
Errorf
(
"stack limit reached (%d)"
,
maxStack
)
}
...
...
@@ -154,6 +154,6 @@ var _baseCheck = map[OpCode]req{
JUMPDEST
:
{
0
,
GasJumpDest
,
false
},
SUICIDE
:
{
1
,
Zero
,
false
},
RETURN
:
{
2
,
Zero
,
false
},
PUSH1
:
{
0
,
GasFastStep
,
true
},
PUSH1
:
{
0
,
GasFast
est
Step
,
true
},
DUP1
:
{
0
,
Zero
,
true
},
}
core/vm/vm.go
View file @
3ea8c730
...
...
@@ -45,23 +45,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
self
.
Printf
(
"(%d) (%x) %x (code=%d) gas: %v (d) %x"
,
self
.
env
.
Depth
(),
caller
.
Address
()
.
Bytes
()[
:
4
],
context
.
Address
(),
len
(
code
),
context
.
Gas
,
callData
)
.
Endl
()
/*
if self.Recoverable {
// Recover from any require exception
defer func() {
if r := recover(); r != nil {
self.Printf(" %v", r).Endl()
context.UseGas(context.Gas)
ret = context.Return(nil)
err = fmt.Errorf("%v", r)
}
}()
}
*/
// User defer pattern to check for an error and, based on the error being nil or not, use all gas and return.
defer
func
()
{
if
err
!=
nil
{
self
.
Printf
(
" %v"
,
err
)
.
Endl
()
...
...
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