• David Chase's avatar
    cmd/internal/gc: move check for large-hence-heap-allocated types into escape analysis · e5060c7f
    David Chase authored
    Before this change, the check for too-large arrays (and other large
    types) occurred after escape analysis.  If the data moved off stack
    and onto the heap contained any pointers, it would therefore escape,
    but because the too-large check occurred after escape analysis this
    would not be recorded and a stack pointer would leak to the heap
    (see the modified escape_array.go for an example).
    
    Some of these appear to remain, in calls to typecheck from within walk.
    
    Also corrected a few comments in escape_array.go about "BAD"
    analysis that is now done correctly.
    
    Enhanced to move aditional EscNone-but-large-so-heap checks into esc.c.
    
    Change-Id: I770c111baff28a9ed5f8beb601cf09dacc561b83
    Reviewed-on: https://go-review.googlesource.com/10268Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    e5060c7f
escape_array.go 3.66 KB