Skip to content

unsafe.Sizeof() behaves incorrectly in global declaration #1608

@gopherbot

Description

@gopherbot

by eleanor@games-with-brains.com:

What steps will reproduce the problem?
    import "unsafe"

    var _a interface{} = 0
    size := unsafe.Sizeof(_a)

What is the expected output?
    The size should be reported as a number of bytes equal to two native pointers.

What do you see instead?
    The size is reported as -1000000000 bytes.

Which compiler are you using (5g, 6g, 8g, gccgo)?
    6g

Which operating system are you using?
    Darwin AMD64

Which revision are you using?  (hg identify)
    c5c62aeb6267 release.2011-03-07.1/release

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions