fix: str+str 运行时拼接 — malloc + strlen + memcpy

- codegen: 声明 CRT 的 malloc/strlen/memcpy
- str+str 拼接: strlen(l)+strlen(r)+1 → malloc → memcpy×2 → 返回指针
- 新增集成测试 08_str_concat.l ("Hello, " + "World!" → "Hello, World!")
- 修复自报告 §5-6 字符串拼接不工作的 bug
This commit is contained in:
2026-06-05 02:36:23 +08:00
parent 9ff2990724
commit 9e41b09318
3 changed files with 335 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
fn main() -> i64 {
let hello: str = "Hello, ";
let world: str = "World!";
let msg: str = hello + world;
print_str(msg);
return 0;
}