bcode_cfg.py 文件源码

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

项目:pythia 作者: elazarg 项目源码 文件源码
def update_stackdepth(cfg):
    '''The stack depth is supposed to be independent of path.
    So dijkstra on the undirected graph suffices (and maybe too strong. we don't need minimality)
    The `undirected` part is just because we want to work
    with unreachable code too. 
    '''
    bidi = gu.copy_to_bidirectional(cfg, weight='stack_effect')
    depths = nx.single_source_dijkstra_path_length(bidi, source=0, weight='stack_effect')
    nx.set_node_attributes(cfg, 'stack_depth', depths)
    return cfg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号