-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.go2go] go/types: don't crash with unsafe.Alignof/Sizeof on a typ…
…e parameter value Report an error instead for now until we have a better idea. (It's unclear what these operations should do as they are defined to return a compile-time constant which we can't know in general.) Fixes #40301. Change-Id: I22a991311de117bc00d52b67b4ce862ea09d855a Reviewed-on: https://go-review.googlesource.com/c/go/+/244622 Reviewed-by: Robert Griesemer <gri@golang.org>
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package p | ||
|
||
import "unsafe" | ||
|
||
func _[type T](x T) { | ||
_ = unsafe /* ERROR undefined */ .Alignof(x) | ||
_ = unsafe /* ERROR undefined */ .Sizeof(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters