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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user