Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug that encode() and decode() are not re-entrant #257

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Conversation

gfx
Copy link
Member

@gfx gfx commented Feb 5, 2025

close #195

$ npx mocha test/reuse-instances-with-extensions.test.ts


  reuse instances with extensions
    1) should encode and decode a bigint


  0 passing (5ms)
  1 failing

  1) reuse instances with extensions
       should encode and decode a bigint:
     RangeError: Extra 6 of 9 byte(s) found at buffer[3]
      at Decoder.createExtraByteError (src/Decoder.ts:274:12)
      at Decoder.decode (src/Decoder.ts:287:18)
      at Context.<anonymous> (test/reuse-instances-with-extensions.test.ts:38:26)
      at processImmediate (node:internal/timers:491:21)

@gfx gfx merged commit c15b989 into main Feb 6, 2025
10 checks passed
@gfx gfx deleted the regression_195 branch February 6, 2025 12:46
@gfx gfx changed the title add a regression test based on #195 Fix a bug that encode() and decode() are not re-entrant #195 Feb 6, 2025
@gfx gfx changed the title Fix a bug that encode() and decode() are not re-entrant #195 Fix a bug that encode() and decode() are not re-entrant Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use reusable encoders/decoders in custom codecs
1 participant