• Dmitriy Vyukov's avatar
    reflect: fix map type generation · 5bc1cef8
    Dmitriy Vyukov authored
    If a map variable is created with reflect.New it has incorrect type (map[unsafe.Pointer]unsafe.Pointer).
    If GC follows such pointer, it scans Hmap and buckets with incorrect type.
    This can lead to overscan of up to 120 bytes for map[int8]struct{}.
    Which in turn can lead to crash if the memory after a bucket object is unaddressable
    or false retention (buckets are scanned as arrays of unsafe.Pointer).
    I don't see how it can lead to heap corruptions, though.
    
    LGTM=khr
    R=rsc, khr
    CC=golang-codereviews
    https://golang.org/cl/96270044
    5bc1cef8
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...