about summary refs log tree commit diff
path: root/src/codegen.pry
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-07-16 12:06:04 +0200
committerBaitinq <[email protected]>2025-07-16 12:06:04 +0200
commitcc9dcb4df11c92bd049b927347cbaa8a8d743783 (patch)
treecf86e69ba00a23c87bcbbabffb7a959c8fcb0fbe /src/codegen.pry
parentTokenizer: Add bounds checking for consume_until_condition (diff)
downloadpry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.tar.gz
pry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.tar.bz2
pry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.zip
Codegen: Cleanup asserts
Diffstat (limited to '')
-rw-r--r--src/codegen.pry9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/codegen.pry b/src/codegen.pry
index ab40c27..b2632c2 100644
--- a/src/codegen.pry
+++ b/src/codegen.pry
@@ -133,10 +133,8 @@ let codegen_create_variable = (c: *codegen, variable: Variable) => *Variable {
 };
 
 let compare_types = (c: *codegen, a: *Node, b: *Node, is_dereference: bool) => bool {
-	assert((*a).type >= NODE_TYPE_SIMPLE_TYPE);
-	assert((*a).type <= NODE_TYPE_STRUCT_TYPE);
-	assert((*b).type >= NODE_TYPE_SIMPLE_TYPE);
-	assert((*b).type <= NODE_TYPE_STRUCT_TYPE);
+	assert((*a).type >= NODE_TYPE_SIMPLE_TYPE and (*a).type <= NODE_TYPE_STRUCT_TYPE);
+	assert((*b).type >= NODE_TYPE_SIMPLE_TYPE and (*b).type <= NODE_TYPE_STRUCT_TYPE);
 
 	if (*a).type == NODE_TYPE_SIMPLE_TYPE {
 		let simple_type_a = *cast(*NODE_TYPE_SIMPLE_TYPE_DATA, (*a).data);
@@ -238,8 +236,7 @@ let compare_types = (c: *codegen, a: *Node, b: *Node, is_dereference: bool) => b
 };
 
 let codegen_get_llvm_type = (c: *codegen, node: *Node) => *LLVMTypeRef {
-	assert((*node).type >= NODE_TYPE_SIMPLE_TYPE);
-	assert((*node).type <= NODE_TYPE_STRUCT_TYPE);
+	assert((*node).type >= NODE_TYPE_SIMPLE_TYPE and (*node).type <= NODE_TYPE_STRUCT_TYPE);
 	
 	if (*node).type == NODE_TYPE_SIMPLE_TYPE {
 		let simple_type = *cast(*NODE_TYPE_SIMPLE_TYPE_DATA, (*node).data);