diff options
| author | Baitinq <[email protected]> | 2025-07-16 12:06:04 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-07-16 12:06:04 +0200 |
| commit | cc9dcb4df11c92bd049b927347cbaa8a8d743783 (patch) | |
| tree | cf86e69ba00a23c87bcbbabffb7a959c8fcb0fbe /src/codegen.pry | |
| parent | Tokenizer: Add bounds checking for consume_until_condition (diff) | |
| download | pry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.tar.gz pry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.tar.bz2 pry-lang-cc9dcb4df11c92bd049b927347cbaa8a8d743783.zip | |
Codegen: Cleanup asserts
Diffstat (limited to '')
| -rw-r--r-- | src/codegen.pry | 9 |
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); |