Skip to content

Commit f6cb6af

Browse files
committed
reflect: move size verifications to value.go, remove useless AVR test
1 parent e1fcf5f commit f6cb6af

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

src/reflect/intw_avr_test.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/reflect/value.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,16 @@ type stringHeader struct {
16021602
len uintptr
16031603
}
16041604

1605+
// Verify SliceHeader and StringHeader sizes.
1606+
// See https://github.com/tinygo-org/tinygo/pull/4156
1607+
// and https://github.com/tinygo-org/tinygo/issues/1284.
1608+
var (
1609+
_ [unsafe.Sizeof([]byte{})]byte = [unsafe.Sizeof(SliceHeader{})]byte{}
1610+
_ [unsafe.Sizeof([]byte{})]byte = [unsafe.Sizeof(sliceHeader{})]byte{}
1611+
_ [unsafe.Sizeof("")]byte = [unsafe.Sizeof(StringHeader{})]byte{}
1612+
_ [unsafe.Sizeof("")]byte = [unsafe.Sizeof(stringHeader{})]byte{}
1613+
)
1614+
16051615
type ValueError struct {
16061616
Method string
16071617
Kind Kind

0 commit comments

Comments
 (0)