[1229] scheme 解析器三处越界读修复(迁移自 pr_4399) - #4401
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
PinkMagicFly
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
从 #4399 迁移 scheme 解析器正确性修复(原 commit 687b0d3):
scheme_der.cpp三处「先读后判界」越界读改为循环顶先判界:ch= s[end_index]unslash尾部ch= s[i]block_bench.cpp失效资源路径(bench/→moebius/bench/)scheme_der_test.cpp9 用例(词元在缓冲区末尾、末尾反斜杠、引号转义、未闭合引号、注释、quote 糖、CR 剔除、block 多表达式)性能持平(block_bench 5.69→5.77 ns/char,噪声内),本项收益是消除 UB,非性能。
Test
xmake test "moebius_tests/*"18 项全过(含新测试)xmake r block_bench路径修复后正常运行gf fmt --changed-since=main通过🤖 Generated with Claude Code