Skip to content

decoder2: fix checking and decoding of escape characters#24915

Merged
spytheman merged 1 commit into
vlang:masterfrom
Larsimusrex:fix_decoder2_escape_chars
Jul 17, 2025
Merged

decoder2: fix checking and decoding of escape characters#24915
spytheman merged 1 commit into
vlang:masterfrom
Larsimusrex:fix_decoder2_escape_chars

Conversation

@Larsimusrex

Copy link
Copy Markdown
Contributor

fix #24834. Modified checker to correctly handle escaped ", also rewrote the string decoder in a correct and faster way.

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23384

Comment thread vlib/x/json2/decoder2/decode.v

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.
The speedup is significant too:

image image

@spytheman spytheman merged commit 54c6daa into vlang:master Jul 17, 2025
73 of 75 checks passed
spytheman added a commit to spytheman/v that referenced this pull request Jul 17, 2025
* master: (22 commits)
  runtime: add used_memory() implementation for FreeBSD (vlang#24909)
  decoder2: fix checking and decoding of escape characters (fix vlang#24834) (vlang#24915)
  runtime: add note for the availability of the used_memory implementation (vlang#24913)
  compress,compress.gzip: add decompress_with_callback API (vlang#24904)
  markused: remove `@[markused]` from option and result fns (vlang#24900)
  ast: fix arch loongarch64 comptime support (fix vlang#24906) (vlang#24907)
  cgen: use alias `next` method if defined in `for x in iterator {` (vlang#24905)
  ci: cleanup produced executables after manually running `v ci/linux_ci.vsh` (vlang#24902)
  ci: skip checking vlib/datatypes/lockfree/ringbuffer_test.v on the gcc-windows job for now
  runtime: reduce allocations done in runtime.used_memory/0 on linux (vlang#24901)
  os: fix windows get_error_msg() leak (vlang#24899)
  runtime: add used_memory() (vlang#24897)
  ci: add `-prealloc` self compilation checks on more platforms (vlang#24891)
  cgen: allow alias types to be iterated if parent type has `next` method (fix vlang#24890) (vlang#24894)
  markused: whitelist `_option_none` too (fix vlang#24862) (vlang#24885)
  markused: fix mark for array init from sumtype (fix vlang#24887) (vlang#24889)
  cgen: add a `__closure_init` call for sokol/gg programs on android as well (vlang#24892)
  builtin,cgen,markused: add struct @[aligned] support for structs allocated on the heap too (vlang#24886)
  math.big: fix toom-cook 3-way multiplication (vlang#24888)
  x.json2.decoder2: fix option decode (fix vlang#24861) (vlang#24881)
  ...
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.

json2.decoder2: cannot decode escaped string value

3 participants