Git Product home page Git Product logo

Comments (6)

loiluu avatar loiluu commented on September 13, 2024

Can you please check this @inian?

from oyente.

inian avatar inian commented on September 13, 2024

Hey, so I think -1 - x is used when x is not a symbolic expression and ~ x is used when x is a symbolic expression where ~ is the z3 bvnot

from oyente.

luongnt95 avatar luongnt95 commented on September 13, 2024

link here python has built-in ~ operator for a real value. In the link, ~ equals to (-x-1) not (-1-x). Anyway, in some test cases I tried ~x the result is correct but some I tried
(2**256 - 1) - x is correct while ~x is incorrect. What do you think about this @inian ?

from oyente.

inian avatar inian commented on September 13, 2024

Hey just realized that the entire code can just be simplified to

first = stack.pop(0)
computed = ~first
stack.insert(0, computed)

can you give me an example where ~x is incorrect? I will also check

from oyente.

luongnt95 avatar luongnt95 commented on September 13, 2024

"code" : "0x600019600055" which is converted to opcodes:
[1] PUSH1 0x00
[2] NOT
[4] PUSH1 0x00
[5] SSTORE
And the result should be:
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"

The number we care about here is 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff which is the result of:
[1] PUSH1 0x00
[2] NOT
This is the test case not0 in vmBitwiseLogicOperationTest.json file

from oyente.

inian avatar inian commented on September 13, 2024

@luongnt95 can u verify if this is fixed?

from oyente.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.