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