Gate‑C(Core) OOB strict fail‑fast; String VM handler normalization; JSON lint Stage‑B root fixes via scanner field boxing and BinOp operand slotify; docs + smokes update

This commit is contained in:
nyash-codex
2025-11-01 18:45:26 +09:00
parent c331296552
commit 47bd2d2ee2
15 changed files with 280 additions and 107 deletions

View File

@ -6,8 +6,9 @@ static box StringUtils {
// ===== 空白処理 =====
// 文字列の前後空白をトリム
// VM側の StringBox.trim() を使用して安全に実装builder依存の算術を避ける
trim(s) {
return this.trim_end(this.trim_start(s))
return s.trim()
}
// 先頭空白をトリム
@ -242,7 +243,8 @@ static box StringUtils {
}
// 先頭ゼロの禁止("0" 単独は許可、符号付きの "-0" も許可)
if s.length() - start > 1 and s.substring(start, start + 1) == "0" {
// subtract を避けて builder の未定義値混入を回避start+1 側で比較)
if s.length() > start + 1 and s.substring(start, start + 1) == "0" {
// 2文字目以降が数字なら先頭ゼロ不正
if this.is_digit(s.substring(start + 1, start + 2)) {
return false