fix: null literal emits 0 in C backend — minimal project builds successfully

This commit is contained in:
2026-05-31 21:05:42 +03:00
parent e2c1a21059
commit 0ae4424bbc
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -99,7 +99,11 @@ func CBE_EmitExpr(cbe: *CEmitter, node: *HirNode) {
// Literal // Literal
if kind == hLit { if kind == hLit {
StringBuilder_Append(&cbe.sb, node.strValue); if node.intValue == tkNull {
StringBuilder_Append(&cbe.sb, "0");
} else {
StringBuilder_Append(&cbe.sb, node.strValue);
}
return; return;
} }
+5 -1
View File
@@ -99,7 +99,11 @@ func CBE_EmitExpr(cbe: *CEmitter, node: *HirNode) {
// Literal // Literal
if kind == hLit { if kind == hLit {
StringBuilder_Append(&cbe.sb, node.strValue); if node.intValue == tkNull {
StringBuilder_Append(&cbe.sb, "0");
} else {
StringBuilder_Append(&cbe.sb, node.strValue);
}
return; return;
} }