Code Monkey home page Code Monkey logo

byteplay's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

byteplay's Issues

stack size computation is broken

I haven't tested the py3 version, but on python 2, this breaks the stack size computation and results in a segmentation fault or an assertion failure if you happen to be running debug python.

The following code prints old stacksize = 2, new stacksize = 0, and then crashes.

def rebuild_function():
    import byteplay as B

    c = B.Code.from_code(func.func_code)
    code = c.to_code()

    args = code, func.func_globals, func.func_name, func.func_defaults, func.func_closure
    return types.FunctionType(*args)

def testfunc():
    return VALUE, ANOTHER

newfunc = rebuild_function(testfunc)

print "Orig stacksize: ", testfunc.func_code.co_stacksize
print "New stacksize: ", newfunc.func_code.co_stacksize

# crashes
newfunc()

reopen: stack size computation is broken #3

I encountered the 'closed' issue reported by @pwaller with Python 3.4. Stack size computation is broken (method '_compute_stacksize') and returns zero for every block of code I tried. As I mentioned in comment of original issue I tried to fix it (peterazmanov/byteplay). My changes stopped crashes, but the code requires further testing.

bytecode3.py has syntax error

Running the 2to3 tool resulted in this addition:

  •                   if jump>0xFFFF:raise NotImplementedError,"Extended jumps not implemented"
    
  •                   if jump>0xFFFF:raise NotImplementedError("Extended jumps not implemented")
    

There were other changes it recommended, but this was the minimum necessary to get byteplay to be able to import without throwing an error.

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.