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
c59c826a
Commit
c59c826a
authored
Apr 03, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed stack level
parent
fd5c5b29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
6 deletions
+32
-6
coin.html
cmd/mist/assets/examples/coin.html
+0
-3
gas.go
core/vm/gas.go
+4
-3
gh_test.go
tests/vm/gh_test.go
+28
-0
No files found.
cmd/mist/assets/examples/coin.html
View file @
c59c826a
...
...
@@ -85,9 +85,6 @@
function
refresh
()
{
document
.
querySelector
(
"#balance"
).
innerHTML
=
contract
.
call
({
from
:
eth
.
coinbase
}).
balance
(
eth
.
coinbase
);
var
table
=
document
.
querySelector
(
"#table_body"
);
table
.
innerHTML
=
""
;
// clear
}
function
transact
()
{
...
...
core/vm/gas.go
View file @
c59c826a
...
...
@@ -2,8 +2,9 @@ package vm
import
(
"fmt"
"github.com/ethereum/go-ethereum/params"
"math/big"
"github.com/ethereum/go-ethereum/params"
)
var
(
...
...
@@ -37,8 +38,8 @@ func baseCheck(op OpCode, stack *stack, gas *big.Int) error {
return
err
}
if
r
.
stackPush
&&
len
(
stack
.
data
)
-
r
.
stackPop
+
1
>
int
(
params
.
StackLimit
.
Int64
())
{
return
fmt
.
Errorf
(
"stack limit reached
(%d)"
,
params
.
StackLimit
.
Int64
())
if
r
.
stackPush
&&
len
(
stack
.
data
)
-
r
.
stackPop
>
int
(
params
.
StackLimit
.
Int64
())
{
return
fmt
.
Errorf
(
"stack limit reached
%d (%d)"
,
len
(
stack
.
data
)
,
params
.
StackLimit
.
Int64
())
}
gas
.
Add
(
gas
,
r
.
gas
)
...
...
tests/vm/gh_test.go
View file @
c59c826a
...
...
@@ -81,6 +81,13 @@ func RunVmTest(p string, t *testing.T) {
helper
.
CreateFileTests
(
t
,
p
,
&
tests
)
for
name
,
test
:=
range
tests
{
/*
vm.Debug = true
helper.Logger.SetLogLevel(5)
if name != "Call1MB1024Calldepth" {
continue
}
*/
db
,
_
:=
ethdb
.
NewMemDatabase
()
statedb
:=
state
.
New
(
common
.
Hash
{},
db
)
for
addr
,
account
:=
range
test
.
Pre
{
...
...
@@ -311,3 +318,24 @@ func TestStateTransaction(t *testing.T) {
const
fn
=
"../files/StateTests/stTransactionTest.json"
RunVmTest
(
fn
,
t
)
}
func
TestCallCreateCallCode
(
t
*
testing
.
T
)
{
const
fn
=
"../files/StateTests/stCallCreateCallCodeTest.json"
RunVmTest
(
fn
,
t
)
}
func
TestMemory
(
t
*
testing
.
T
)
{
const
fn
=
"../files/StateTests/stMemoryTest.json"
RunVmTest
(
fn
,
t
)
}
func
TestQuadraticComplexity
(
t
*
testing
.
T
)
{
t
.
Skip
()
// takes too long
const
fn
=
"../files/StateTests/stQuadraticComplexityTest.json"
RunVmTest
(
fn
,
t
)
}
func
TestSolidity
(
t
*
testing
.
T
)
{
const
fn
=
"../files/StateTests/stSolidityTest.json"
RunVmTest
(
fn
,
t
)
}
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