Skip to content

cmd/compile: internal compiler error: assertion failed (on 1.18 and tip) #53390

Closed
@ALTree

Description

@ALTree

This program:

package main

import (
	"reflect"
	"unsafe"
)

func F[T any](v T) uintptr {
	return unsafe.Alignof(func() T {
		_ = reflect.DeepEqual(struct{ _ T }{}, nil)
		return v
	}())
}

func main() {
	F(0)
}

crashes both the 1.18.3 and the tip compiler with this error:

$ go build crash.go

# command-line-arguments
.\crash.go:16:3: internal compiler error: assertion failed

cc @mdempsky @randall77

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions