1. 15 Feb, 2017 1 commit
  2. 14 Feb, 2017 5 commits
    • Kamil Kisiel's avatar
      Update README.md · c7dbf2e4
      Kamil Kisiel authored
      c7dbf2e4
    • Kamil Kisiel's avatar
      Update .travis.yml · 9474da06
      Kamil Kisiel authored
      9474da06
    • Kamil Kisiel's avatar
      Merge pull request #26 from navytux/fix1 · 90bef817
      Kamil Kisiel authored
      Misc fixes (error + opStop handling)
      90bef817
    • Kirill Smelkov's avatar
      decoder: Return EOF, not panic on a proper end of stream · 995fce81
      Kirill Smelkov authored
      io.EOF handling was already there in instructions decoding loop, but it
      was simply breaking out of the loop and in the end decode
      unconditionally was trying to pop top element from stack, and since
      stack is empty panicked. E.g. for "" input this way:
      
      --- FAIL: TestDecode (0.00s)
      panic: runtime error: index out of range [recovered]
              panic: runtime error: index out of range
      
      goroutine 20 [running]:
      testing.tRunner.func1(0xc4200765b0)
              /home/kirr/src/tools/go/go/src/testing/testing.go:624 +0x267
      panic(0x5368c0, 0x603010)
              /home/kirr/src/tools/go/go/src/runtime/panic.go:489 +0x26e
      github.com/kisielk/og-rek.Decoder.Decode(0xc4200ea5a0, 0x624908, 0x0, 0x0, 0xc4200e6b10, 0x52a180, 0xc4200ee308, 0x0, 0x0)
              /home/kirr/src/wendelin/neo/g.neo/src/github.com/kisielk/og-rek/ogorek.go:250 +0x4bb
      github.com/kisielk/og-rek.TestDecode(0xc4200765b0)
              /home/kirr/src/wendelin/neo/g.neo/src/github.com/kisielk/og-rek/ogorek_test.go:80 +0x232f
      testing.tRunner(0xc4200765b0, 0x567648)
              /home/kirr/src/tools/go/go/src/testing/testing.go:659 +0x98
      created by testing.(*T).Run
              /home/kirr/src/tools/go/go/src/testing/testing.go:701 +0x2df
      exit status 2
      
      Fix it via reworking EOF handling:
      
      - if we see EOF and no instructions was decoded so far - just return it
        to the caller
      
      - if we see EOF in the middle of the stream - as valid pickle streams
        end with Stop opcode - it is unexpected EOF - return it as such.
      
      A couple of tests had to be adjusted in TestDecode - as input there was
      not a valid pickle - not ending with "." (which python pickle decoder
      also does not decode at all).
      995fce81
    • Kirill Smelkov's avatar
      decoder: Really stop decoding on opStop opcode · 9f73742b
      Kirill Smelkov authored
      There was a break already on a `case opStop:` but break inside switch
      only breaks out of this switch, not outer construct - looks like it was
      a thinko.
      
      So on opStop let's explicitly break out of instruction processing loop.
      
      If we do not do so on e.g "I5\n.I7\n.N." input first call to .Decode()
      returns None (from N.), not 5 and second call to Decode() panics (for
      this see next patch).
      9f73742b
  3. 13 Feb, 2017 1 commit
  4. 04 Jan, 2016 1 commit
  5. 01 Jan, 2016 1 commit
  6. 30 Dec, 2015 3 commits
  7. 23 Jun, 2015 4 commits
  8. 22 Jun, 2015 1 commit
  9. 19 Jun, 2015 3 commits
  10. 18 Jun, 2015 2 commits
  11. 12 Jun, 2015 1 commit
  12. 28 Jan, 2015 1 commit
  13. 20 Oct, 2014 3 commits
  14. 15 Oct, 2014 2 commits
  15. 30 Sep, 2014 3 commits
  16. 18 Sep, 2014 1 commit
  17. 17 Sep, 2014 1 commit
    • Damian Gryski's avatar
      Fix struct encoding · 0ade5ddc
      Damian Gryski authored
      There was accidentally an extra empty dict.  Also, reduce the scope of a
      local variable.
      0ade5ddc
  18. 24 Jul, 2014 2 commits
  19. 11 Jul, 2014 2 commits
  20. 30 Jun, 2014 2 commits