about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-07-13 11:08:50 +0200
committerBaitinq <[email protected]>2025-07-13 11:08:50 +0200
commitcb96e96aee2e1f862797d4abe30075849f3d2929 (patch)
tree408d3e6007e66b124db95ce11212071f89d8c675
parentBoostrap: Fix pointer derefence (diff)
downloadpry-lang-cb96e96aee2e1f862797d4abe30075849f3d2929.tar.gz
pry-lang-cb96e96aee2e1f862797d4abe30075849f3d2929.tar.bz2
pry-lang-cb96e96aee2e1f862797d4abe30075849f3d2929.zip
Boostrap: Support assigning to ptrs
Diffstat (limited to '')
-rw-r--r--src/bootstrap/codegen.pry12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bootstrap/codegen.pry b/src/bootstrap/codegen.pry
index b627114..57f5472 100644
--- a/src/bootstrap/codegen.pry
+++ b/src/bootstrap/codegen.pry
@@ -789,6 +789,18 @@ let codegen_generate_assignment_statement = (c: *codegen, stmt: *NODE_ASSIGNMENT
 
 		return 0;
 	};
+	
+	if (lhs.type == NODE_UNARY_EXPRESSION) {
+		let xd = (*cast(*NODE_UNARY_EXPRESSION_DATA, lhs.data)).expression;
+		let a = codegen_generate_expression_value(c, xd, cast(*i8, null));
+		assert(a != cast(*Variable, null));
+		let variable = codegen_generate_expression_value(c, prhs, cast(*i8, null));
+		assert(variable != cast(*Variable, null));
+		/* TODO: Check type */
+		LLVMBuildStore((*c).builder, (*variable).value, (*a).value);
+
+		return 0;
+	};
 
 	printf("ASSERT 2 %d\n", lhs.type);
 	assert(false);