{"action":"created","issue":{"url":"https://api.github.com/repos/zetamatta/nyagos/issues/87","labels_url":"https://api.github.com/repos/zetamatta/nyagos/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/zetamatta/nyagos/issues/87/comments","events_url":"https://api.github.com/repos/zetamatta/nyagos/issues/87/events","html_url":"https://github.com/zetamatta/nyagos/issues/87","id":106572794,"number":87,"title":"実行ファイルでないファイルを実行しようとするとpanic","user":{"login":"nocd5","id":1814879,"avatar_url":"https://avatars.githubusercontent.com/u/1814879?v=3","gravatar_id":"","url":"https://api.github.com/users/nocd5","html_url":"https://github.com/nocd5","followers_url":"https://api.github.com/users/nocd5/followers","following_url":"https://api.github.com/users/nocd5/following{/other_user}","gists_url":"https://api.github.com/users/nocd5/gists{/gist_id}","starred_url":"https://api.github.com/users/nocd5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nocd5/subscriptions","organizations_url":"https://api.github.com/users/nocd5/orgs","repos_url":"https://api.github.com/users/nocd5/repos","events_url":"https://api.github.com/users/nocd5/events{/privacy}","received_events_url":"https://api.github.com/users/nocd5/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zetamatta/nyagos/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"zetamatta","id":3752189,"avatar_url":"https://avatars.githubusercontent.com/u/3752189?v=3","gravatar_id":"","url":"https://api.github.com/users/zetamatta","html_url":"https://github.com/zetamatta","followers_url":"https://api.github.com/users/zetamatta/followers","following_url":"https://api.github.com/users/zetamatta/following{/other_user}","gists_url":"https://api.github.com/users/zetamatta/gists{/gist_id}","starred_url":"https://api.github.com/users/zetamatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetamatta/subscriptions","organizations_url":"https://api.github.com/users/zetamatta/orgs","repos_url":"https://api.github.com/users/zetamatta/repos","events_url":"https://api.github.com/users/zetamatta/events{/privacy}","received_events_url":"https://api.github.com/users/zetamatta/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-09-15T14:48:09Z","updated_at":"2015-09-16T02:58:56Z","closed_at":null,"body":"存在するが、実行ファイルでないファイルを叩くとpanicで落ちます。\r\n\r\n```\r\n[I:/Freespace/go/nyagos/nyagos]\r\n$ echo > foo.bar\r\n[I:/Freespace/go/nyagos/nyagos]\r\n$ foo.bar\r\n************ Panic Occured. ***********\r\nruntime error: invalid memory address or nil pointer dereference\r\nI:/Freespace/go/nyagos/nyagos/main/nyagos.go:84 (0x40c4eb)\r\n        when_panic: debug.PrintStack()\r\nC:/Tools/GoDev/src/runtime/asm_386.s:442 (0x458dba)\r\n        call16: CALLFN(·call16, 16)\r\nC:/Tools/GoDev/src/runtime/panic.go:423 (0x43569d)\r\n        gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))\r\nC:/Tools/GoDev/src/runtime/panic.go:42 (0x434173)\r\n        panicmem: panic(memoryError)\r\nC:/Tools/GoDev/src/runtime/signal_windows.go:161 (0x4446f1)\r\n        sigpanic: panicmem()\r\nI:/Freespace/go/nyagos/nyagos/interpreter/interpreter.go:180 (0x48193a)\r\n        (*Interpreter).spawnvp_noerrmsg: errorlevel, errorlevelOk := GetErrorLevel(this.ProcessState)\r\nI:/Freespace/go/nyagos/nyagos/interpreter/interpreter.go:189 (0x4819af)\r\n        (*Interpreter).Spawnvp: errorlevel, err := this.spawnvp_noerrmsg()\r\nI:/Freespace/go/nyagos/nyagos/interpreter/interpreter.go:275 (0x4827a2)\r\n        (*Interpreter).Interpret: errorlevel, err = cmd.Spawnvp()\r\nI:/Freespace/go/nyagos/nyagos/main/nyagos.go:215 (0x40e2b4)\r\n        main: whatToDo, err := it.Interpret(line)\r\nC:/Tools/GoDev/src/runtime/proc.go:111 (0x437944)\r\n        main: main_main()\r\nC:/Tools/GoDev/src/runtime/asm_386.s:1662 (0x45ac71)\r\n        goexit: BYTE    $0x90   // NOP\r\n*** Please copy these error message ***\r\n*** And hit ENTER key to quit.      ***\r\n```"},"comment":{"url":"https://api.github.com/repos/zetamatta/nyagos/issues/comments/140610925","html_url":"https://github.com/zetamatta/nyagos/issues/87#issuecomment-140610925","issue_url":"https://api.github.com/repos/zetamatta/nyagos/issues/87","id":140610925,"user":{"login":"zetamatta","id":3752189,"avatar_url":"https://avatars.githubusercontent.com/u/3752189?v=3","gravatar_id":"","url":"https://api.github.com/users/zetamatta","html_url":"https://github.com/zetamatta","followers_url":"https://api.github.com/users/zetamatta/followers","following_url":"https://api.github.com/users/zetamatta/following{/other_user}","gists_url":"https://api.github.com/users/zetamatta/gists{/gist_id}","starred_url":"https://api.github.com/users/zetamatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetamatta/subscriptions","organizations_url":"https://api.github.com/users/zetamatta/orgs","repos_url":"https://api.github.com/users/zetamatta/repos","events_url":"https://api.github.com/users/zetamatta/events{/privacy}","received_events_url":"https://api.github.com/users/zetamatta/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T02:58:56Z","updated_at":"2015-09-16T02:58:56Z","body":"ご連絡ありがとうございます。エラーコード(ERRORLEVEL)を得る処理に不具合がありました。\r\n\r\nos.exec.Cmd.Run() でコマンドの起動に失敗した時、os.exec.Cmd.ProcessState が nil になるようなのですが、ERRORLEVEL を得るために nil チェックなしにそのメンバを参照していました。\r\n\r\ndbcf48125f3b5b472cac81ef9ebfe67021866194　のとおりに修正し、こちらでは症状が解消したようなので、お手数ですがご確認いただけますでしょうか。"}}