From 0111978da7b1643d92fb70461cb44ab9723896c7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 23 Oct 2026 01:24:49 +0000 Subject: fix(stdlib): reject NaN, infinity and hexadecimal text in IS_NUM, STR_TO_NUM and INPUT Co-Authored-By: Claude Opus 5.5 --- AGENTS/PITFALLS/core-language.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'AGENTS') diff --git a/AGENTS/PITFALLS/core-language.md b/AGENTS/PITFALLS/core-language.md index 5ff97ca..5018fb3 100644 --- a/AGENTS/PITFALLS/core-language.md +++ b/AGENTS/PITFALLS/core-language.md @@ -32,7 +32,7 @@ source, most also by compiling and running test programs. - **`/` always yields REAL** (double FDiv), even for two INTEGERs; integer division is DIV/MOD only. - CHR returns CHAR, not STRING; CHR(0) is a NUL CHAR that converts to a one-byte STRING. - - STR_TO_NUM always returns REAL and shares parseNumber (strtod, full consumption, overflow rejected) with IS_NUM. + - STR_TO_NUM always returns REAL and shares parseNumber (strtod, full consumption, overflow rejected, only `0-9 . e E + -` after leading whitespace, so no nan/inf/hex) with IS_NUM and INPUT REAL (`__cps_parse_real` in InputGen.cc); change them together. - NUM_TO_STR keeps the full signed i64 range for INTEGER; REAL uses the shortest round-trip text (realText in string.cc), byte-identical to OUTPUT's IR helper in OutputGen.cc (`__cps_output_real`); change both together. C_DOUBLE output keeps `%f`. -- cgit v1.3.1-4-g156e