bcode_cfg.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:pythia 作者: elazarg 项目源码 文件源码
def make_bcode_block_cfg(instructions):
    dbs = {b.offset: b for b in instructions}
    cfg = nx.DiGraph([(b.offset, dbs[j].offset, {'stack_effect': stack_effect})
                    for b in dbs.values()
                    for (j, stack_effect) in b.next_list() if dbs.get(j)])
    nx.set_node_attributes(cfg, name='BCode', values=dbs)
    update_stackdepth(cfg)
    # each node will hold a block of dictionaries - bcode and stack_depth
    basic_block_cfg = gu.contract_chains(cfg, blockname=BLOCKNAME)
    return basic_block_cfg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号