Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: pick out Stack changes #6

Merged
merged 4 commits into from
Jan 16, 2023
Merged

Conversation

Vvaradinov
Copy link

@Vvaradinov Vvaradinov commented Jan 16, 2023

This PR refactors the default vm.Stack and it's usage across the codebase.

@@ -871,9 +871,9 @@
)
*pc += 1
if *pc < codeLen {
scope.Stack.push(integer.SetUint64(uint64(scope.Contract.Code[*pc])))
scope.Stack.Push(integer.SetUint64(uint64(scope.Contract.Code[*pc])))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
return nil, nil
}

func opMsize(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
scope.Stack.push(new(uint256.Int).SetUint64(uint64(scope.Memory.Len())))
scope.Stack.Push(new(uint256.Int).SetUint64(uint64(scope.Memory.Len())))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@@ -316,7 +316,7 @@
}

func gasExpEIP158(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) {
expByteLen := uint64((stack.data[stack.len()-2].BitLen() + 7) / 8)
expByteLen := uint64((stack.Data[stack.Len()-2].BitLen() + 7) / 8)

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@@ -303,7 +303,7 @@
}

func gasExpFrontier(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) {
expByteLen := uint64((stack.data[stack.len()-2].BitLen() + 7) / 8)
expByteLen := uint64((stack.Data[stack.Len()-2].BitLen() + 7) / 8)

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@Vvaradinov Vvaradinov marked this pull request as ready for review January 16, 2023 15:00
CHANGELOG.md Outdated Show resolved Hide resolved
@Vvaradinov Vvaradinov merged commit 01221e9 into master Jan 16, 2023
@Vvaradinov Vvaradinov deleted the Vvaradinov/stack-changes branch January 16, 2023 17:47
@fedekunze
Copy link

@Mergifyio backport release/1.10

mergify bot pushed a commit that referenced this pull request Jan 31, 2023
(cherry picked from commit 01221e9)

# Conflicts:
#	CHANGELOG.md
#	core/vm/eips.go
#	core/vm/instructions.go
#	core/vm/instructions_test.go
#	eth/tracers/native/call.go
@mergify
Copy link

mergify bot commented Jan 31, 2023

backport release/1.10

✅ Backports have been created

facs95 added a commit that referenced this pull request Feb 1, 2023
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants