Hacker News new | ask | show | jobs
by maple3142 771 days ago
The example given by parent does not need eval to trigger though. Just create a function and replace its code object then call it, it will easily segfault.
1 comments

Complete example without eval:

  def f(): pass
  f.__code__ = f.__code__.replace(co_consts=())
  f()
yup, eval was just there for golfing purposes