• Josh Bleecher Snyder's avatar
    cmd/link: make stkcheck more flexible · ca19e55f
    Josh Bleecher Snyder authored
    stkcheck is flow-insensitive: It processes calls in PC order.
    Since morestack was always the first call in a function,
    it was a safe, conservative approximation to simply adjust stack
    space as we went, recognizing morestack when it showed up.
    
    Subsequent CLS will rearrange the function prologue;
    morestack may no longer be the first call in a function.
    
    Introducing flow-sensitivity to stkcheck would allow this,
    and possibly allow a smaller stackguard.
    It is also a high risk change and possibly expensive.
    
    Instead, assume that all calls to morestack occur as
    part of the function prologue, no matter where they
    are located in the program text.
    
    Updates #10587.
    
    Change-Id: I4dcdd4256a980fc4bc433a68a10989ff57f7034f
    Reviewed-on: https://go-review.googlesource.com/10496
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarRuss Cox <rsc@golang.org>
    ca19e55f
lib.go 48.9 KB