diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 05:25:09 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 05:25:09 +0000 |
| commit | 38ff4e782ef844a21512eb2ca0e491387ae89ec5 (patch) | |
| tree | d9097aa5c8c5989b7dd4f9ee1c34dbcf28750fcb /AGENTS/CONVENTIONS.md | |
| parent | a6fc1625ea8f825a7161354eb9167a281542fa29 (diff) | |
fix: compare strings by content
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS/CONVENTIONS.md')
| -rw-r--r-- | AGENTS/CONVENTIONS.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/AGENTS/CONVENTIONS.md b/AGENTS/CONVENTIONS.md index 6681d1a..e2c6ebd 100644 --- a/AGENTS/CONVENTIONS.md +++ b/AGENTS/CONVENTIONS.md @@ -57,6 +57,13 @@ CHAR = `i8`, STRING = opaque `ptr` to a NUL-terminated buffer. Some code still i pseudocode types *backwards* from LLVM types (`getExprTypeInfo`'s fallback, `ArithmeticHandler`'s `isIntegerTy(64)` tests), so these widths are ABI. +**Reference storage does not imply address comparison.** Compare values by content; +only explicitly declared pointer types compare addresses. STRING's six comparison +operators use `strcmp` in `StringHandler`, dispatched by pseudocode type in CodeGen +before ArithmeticHandler. Ordering is case-sensitive byte lexicographic order; +mixed STRING/non-STRING comparisons are errors. Whole-array and record comparisons +remain unsupported. + **Strings are malloc'd and never freed — by design.** Every string-producing operation (`&`, MID/LEFT/RIGHT/LCASE/UCASE, NUM_TO_STR, CHR, READFILE, CHAR/number→STRING coercion) mallocs a fresh buffer; string literals and BOOLEAN→STRING coercion instead |
