NB I’m unable to reproduce this bug without the pointer indirection.
On Tuesday, September 4, 2018 at 3:38:35 AM UTC+10, Sam Whited wrote:
>
> On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote:
> > type S []int
> >
> > func (s *S) Last() int {
> > return (*s)[len(*s) - 1]
> > }
>
NB I']m
On Tuesday, September 4, 2018 at 3:38:35 AM UTC+10, Sam Whited wrote:
>
> On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote:
> > type S []int
> >
> > func (s *S) Last() int {
> > return (*s)[len(*s) - 1]
> > }
>
> On an unrelated matter, the extra indirection is (probably)
Thanks, that looks like what I’m seeing (I’m able to coax it to produce a
pointer which segfaults the runtime).
On Tuesday, September 4, 2018 at 3:34:43 AM UTC+10, Paul Jolly wrote:
>
> I suspect that you've just run into some variation on
> https://github.com/golang/go/issues/27378
>
> Giovan
On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote:
> type S []int
>
> func (s *S) Last() int {
> return (*s)[len(*s) - 1]
> }
On an unrelated matter, the extra indirection is (probably) not what you want
here, slices are already a pointer type. For more information see
https://blog.go
I suspect that you've just run into some variation on
https://github.com/golang/go/issues/27378
Giovanni/Daniel/others better placed might be able to confirm more
precisely however.
On Mon, 3 Sep 2018 at 17:49, wrote:
>
> Hi all,
>
> Since Go 1.11, the following test seems to pass when I would
Hi all,
Since Go 1.11, the following test seems to pass when I would expect it to
panic with index out of range:
package weirdness
import "testing"
type S []int
func (s *S) Last() int {
return (*s)[len(*s) - 1]
}
func TestWeirdness(t *testing.T) {
var s S
defer func() {}()