-
Notifications
You must be signed in to change notification settings - Fork 772
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
Restrict direct stack usage in opfns #240
Conversation
@@ -470,6 +470,8 @@ module.exports = { | |||
return loaded | |||
}, | |||
DUP: function (runState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually for DUP
we could change the opcodes table to say takes 1 off and pushes 2 new items, but that makes it just more complex here.
@hugo-dc I cannot yet request a review until you join the org, but please ave a look |
@@ -1023,8 +1028,7 @@ function makeCall (runState, callOptions, localOpts, cb) { | |||
// check if account has enough ether | |||
// Note: in the case of delegatecall, the value is persisted and doesn't need to be deducted again | |||
if (runState.depth >= fees.stackLimit.v || (callOptions.delegatecall !== true && new BN(runState.contract.balance).lt(callOptions.value))) { | |||
runState.stack.push(Buffer.from([0])) | |||
cb(null) | |||
cb(null, Buffer.from([0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the reason which makes #222 fail on calls.
Changes looks good, I added the changes to my local copy and now all tests are passing. 👍 |
Issue found in #222.