Skip to content

Fix userdata msgpack emission using empty string instead of emitter output#397

Open
traitimtrongvag wants to merge 1 commit into
vstakhov:masterfrom
traitimtrongvag:fix/msgpack-userdata
Open

Fix userdata msgpack emission using empty string instead of emitter output#397
traitimtrongvag wants to merge 1 commit into
vstakhov:masterfrom
traitimtrongvag:fix/msgpack-userdata

Conversation

@traitimtrongvag

@traitimtrongvag traitimtrongvag commented Jun 26, 2026

Copy link
Copy Markdown

The msgpack emitter calls the userdata emitter callback but ignores the returned value and always serializes "obj->value.sv" and "obj->len" instead.

For userdata objects these fields are never populated, so msgpack output becomes an empty string regardless of what the emitter returns.

This change makes the msgpack path use the emitter output, matching the existing behavior used by the JSON emitter.

Testing

  • Verified userdata objects with a custom emitter now serialize the expected value.
  • Verified emitter callbacks returning NULL are handled correctly.
  • Verified userdata objects without an emitter continue to behave correctly.

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.

1 participant