good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
maticnetwork
bor
Commits
a22056db
Commit
a22056db
authored
10 years ago
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Make an attempt to pay for the gas prior to expanding the mem.
parent
beb7d35c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/vm/gh_test.go
+4
-1
4 additions, 1 deletion
tests/vm/gh_test.go
vm/closure.go
+1
-1
1 addition, 1 deletion
vm/closure.go
vm/vm_debug.go
+2
-1
2 additions, 1 deletion
vm/vm_debug.go
with
7 additions
and
3 deletions
tests/vm/gh_test.go
+
4
−
1
View file @
a22056db
...
...
@@ -2,6 +2,7 @@ package vm
import
(
"bytes"
"fmt"
"testing"
"github.com/ethereum/go-ethereum/ethutil"
...
...
@@ -44,6 +45,7 @@ func RunVmTest(p string, t *testing.T) {
helper
.
CreateFileTests
(
t
,
p
,
&
tests
)
for
name
,
test
:=
range
tests
{
fmt
.
Println
(
name
)
state
:=
state
.
New
(
helper
.
NewTrie
())
for
addr
,
account
:=
range
test
.
Pre
{
obj
:=
StateObjectFromAccount
(
addr
,
account
)
...
...
@@ -113,7 +115,7 @@ func TestEnvironmentalInfo(t *testing.T) {
}
func
TestFlowOperation
(
t
*
testing
.
T
)
{
helper
.
Logger
.
SetLogLevel
(
5
)
//
helper.Logger.SetLogLevel(5)
const
fn
=
"../files/vmtests/vmIOandFlowOperationsTest.json"
RunVmTest
(
fn
,
t
)
}
...
...
@@ -124,6 +126,7 @@ func TestPushDupSwap(t *testing.T) {
}
func
TestVMSha3
(
t
*
testing
.
T
)
{
helper
.
Logger
.
SetLogLevel
(
5
)
const
fn
=
"../files/vmtests/vmSha3Test.json"
RunVmTest
(
fn
,
t
)
}
...
...
This diff is collapsed.
Click to expand it.
vm/closure.go
+
1
−
1
View file @
a22056db
...
...
@@ -64,7 +64,7 @@ func (c *Closure) GetOp(x int) OpCode {
}
func
(
c
*
Closure
)
GetByte
(
x
int
)
byte
{
if
x
<
len
(
c
.
Code
)
{
if
x
>
-
1
&&
x
<
len
(
c
.
Code
)
{
return
c
.
Code
[
x
]
}
...
...
This diff is collapsed.
Click to expand it.
vm/vm_debug.go
+
2
−
1
View file @
a22056db
...
...
@@ -277,7 +277,6 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
addStepGasUsage
(
memGasUsage
)
mem
.
Resize
(
newMemSize
.
Uint64
())
}
}
...
...
@@ -295,6 +294,8 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
return
closure
.
Return
(
nil
),
OOG
(
gas
,
tmp
)
}
mem
.
Resize
(
newMemSize
.
Uint64
())
switch
op
{
// 0x20 range
case
ADD
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment