Skip to content

casting unsafe.Pointer to *foo #492

Closed
@gopherbot

Description

@gopherbot

by kai.backman2:

repro on both 6g/darwin and 5g:

package main

import (
    "unsafe"
)

func main() {

    // works
    addr := uintptr(0xfffff400)
    _ = (*int)(unsafe.Pointer(addr))

    // fails
    _ = (*int)(unsafe.Pointer(uintptr(0xfffff400)))
}

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