Skip to content

Commit 3611f30

Browse files
committed
panic explicit on nil ptr receiver
1 parent 6d85d69 commit 3611f30

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

bartmethodsgenerated.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commonmethods_tmpl.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ func (t *_TABLE_TYPE[V]) Overlaps6(o *_TABLE_TYPE[V]) bool {
432432
// This duplicate is shallow-copied by default, but if the value type V implements the
433433
// Clone method, the value is deeply cloned before insertion. See also _TABLE_TYPE.Clone.
434434
func (t *_TABLE_TYPE[V]) Union(o *_TABLE_TYPE[V]) {
435-
_ = t.size4 // nil pointer check
435+
if t == nil {
436+
panic("nil ptr receiver")
437+
}
436438

437439
if o.size4 == 0 && o.size6 == 0 {
438440
return
@@ -674,7 +676,9 @@ func (t *_TABLE_TYPE[V]) AllSorted6() iter.Seq2[netip.Prefix, V] {
674676
// │ └─ 2001:db8::/32 (V)
675677
// └─ fe80::/10 (V)
676678
func (t *_TABLE_TYPE[V]) Fprint(w io.Writer) error {
677-
_ = t.size4
679+
if t == nil {
680+
panic("nil ptr receiver")
681+
}
678682

679683
if w == nil {
680684
return fmt.Errorf("nil writer")

fastmethodsgenerated.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litemethodsgenerated.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)