{"action":"reopened","issue":{"url":"https://api.github.com/repos/mvdan/sh/issues/7","repository_url":"https://api.github.com/repos/mvdan/sh","labels_url":"https://api.github.com/repos/mvdan/sh/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/mvdan/sh/issues/7/comments","events_url":"https://api.github.com/repos/mvdan/sh/issues/7/events","html_url":"https://github.com/mvdan/sh/issues/7","id":158418963,"number":7,"title":"parse: index out of range panic with heredocs and logical ops","user":{"login":"ebfe","id":685065,"avatar_url":"https://avatars.githubusercontent.com/u/685065?v=3","gravatar_id":"","url":"https://api.github.com/users/ebfe","html_url":"https://github.com/ebfe","followers_url":"https://api.github.com/users/ebfe/followers","following_url":"https://api.github.com/users/ebfe/following{/other_user}","gists_url":"https://api.github.com/users/ebfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ebfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebfe/subscriptions","organizations_url":"https://api.github.com/users/ebfe/orgs","repos_url":"https://api.github.com/users/ebfe/repos","events_url":"https://api.github.com/users/ebfe/events{/privacy}","received_events_url":"https://api.github.com/users/ebfe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mvdan/sh/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-03T17:47:42Z","updated_at":"2016-06-05T01:07:31Z","closed_at":null,"body":"    $ cat x.bash\r\n    cat <<FOO|rev&&echo done \r\n    foobar\r\n    FOO\r\n    $ bash x.bash\r\n    raboof\r\n    done\r\n    $ shfmt x.bash\r\n    panic: runtime error: index out of range\r\n    \r\n    goroutine 1 [running]:\r\n    panic(0x4e4320, 0xc820010160)\r\n    \t/home/ebfe/src/go/src/runtime/panic.go:500 +0x18a\r\n    github.com/mvdan/sh.(*parser).doHeredocs(0xc82008dae8)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:355 +0x1e3\r\n    github.com/mvdan/sh.(*parser).next(0xc82008dae8)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:239 +0x267\r\n    github.com/mvdan/sh.(*parser).got(0xc82008dae8, 0xfffffffffffffffd, 0xc82000a700)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:425 +0x42\r\n    github.com/mvdan/sh.(*parser).wordPart(0xc82008dae8, 0xb, 0xb)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:647 +0x79e\r\n    github.com/mvdan/sh.(*parser).readParts(0xc82008dae8, 0xc82000a7c0)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:599 +0x25\r\n    github.com/mvdan/sh.(*parser).gotWord(0xc82008dae8, 0xc82000a7c0, 0x5ba000)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:584 +0x2d\r\n    github.com/mvdan/sh.(*parser).cmdOrFunc(0xc82008dae8, 0xffffffffffffffe4, 0x0)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:1306 +0x1fd\r\n    github.com/mvdan/sh.(*parser).gotStmtPipe(0xc82008dae8, 0xc82005a540, 0x0)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:1030 +0x95d\r\n    github.com/mvdan/sh.(*parser).gotStmtAndOr(0xc82008dae8, 0xc82005a540, 0x0, 0x0, 0x0, 0x5ba040)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:992 +0x2a2\r\n    github.com/mvdan/sh.(*parser).gotStmt(0xc82008dae8, 0xc82005a540, 0x0, 0x0, 0x0, 0x409e90)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:965 +0xc4\r\n    github.com/mvdan/sh.(*parser).followStmt(0xc82008dae8, 0x1, 0xe, 0x506d35, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:468 +0x8e\r\n    github.com/mvdan/sh.(*parser).binaryStmt(0xc82008dae8, 0x58b900, 0xc82004c440, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:1052 +0x17f\r\n    github.com/mvdan/sh.(*parser).gotStmtAndOr(0xc82008dae8, 0xc82005a300, 0x0, 0x0, 0x0, 0xc82002a050)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:998 +0x31a\r\n    github.com/mvdan/sh.(*parser).gotStmt(0xc82008dae8, 0xc82005a300, 0x0, 0x0, 0x0, 0x1000)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:965 +0xc4\r\n    github.com/mvdan/sh.(*parser).stmts(0xc82008dae8, 0x0, 0x0, 0x0, 0x1000, 0x1000, 0x20)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:555 +0x119\r\n    github.com/mvdan/sh.Parse(0x58b300, 0xc82002a048, 0x7fff891c654b, 0xf, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/parse.go:38 +0x119\r\n    main.format(0x7fff891c654b, 0xf, 0x58cb40, 0xc82005d6c0)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/cmd/shfmt/main.go:75 +0xbc\r\n    main.work(0x7fff891c654b, 0xf, 0x0, 0x0)\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/cmd/shfmt/main.go:49 +0xb4\r\n    main.main()\r\n    \t/home/ebfe/go/src/github.com/mvdan/sh/cmd/shfmt/main.go:28 +0x68\r\n"}}
{"actor":{"display_login":"mvdan"}}