diff --git a/src/eval/eval_ir.c b/src/eval/eval_ir.c index 3e34a22a..83876875 100644 --- a/src/eval/eval_ir.c +++ b/src/eval/eval_ir.c @@ -1184,6 +1184,7 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I #define E_ArithPath_PtrAdd 1 #define E_ArithPath_PtrSub 2 #define E_ArithPath_PtrArrayCompare 3 +#define E_ArithPath_TypeCompare 4 B32 ptr_arithmetic_mul_rptr = 0; U32 arith_path = E_ArithPath_Normal; if(kind == E_ExprKind_Add) @@ -1216,7 +1217,7 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I } } } - else if(kind == E_ExprKind_EqEq) + else if(kind == E_ExprKind_EqEq || kind == E_ExprKind_NtEq) { if(l_type_kind == E_TypeKind_Array && (r_type_kind == E_TypeKind_Ptr || r_is_decay)) { @@ -1226,6 +1227,10 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I { arith_path = E_ArithPath_PtrArrayCompare; } + if(l_tree.mode == E_Mode_Null && r_tree.mode == E_Mode_Null) + { + arith_path = E_ArithPath_TypeCompare; + } } // rjf: generate according to arithmetic path @@ -1360,6 +1365,14 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I result.type_key = e_type_key_basic(E_TypeKind_Bool); result.mode = E_Mode_Value; }break; + + //- rjf: type comparison + case E_ArithPath_TypeCompare: + { + result.root = e_irtree_const_u(arena, !!e_type_match(l_type, r_type)); + result.type_key = e_type_key_basic(E_TypeKind_Bool); + result.mode = E_Mode_Value; + }break; } }break; diff --git a/src/os/core/linux/os_core_linux.c b/src/os/core/linux/os_core_linux.c index c61fa270..16b1e474 100644 --- a/src/os/core/linux/os_core_linux.c +++ b/src/os/core/linux/os_core_linux.c @@ -1175,8 +1175,8 @@ os_semaphore_drop(OS_Handle semaphore) internal OS_Handle os_barrier_alloc(U64 count) { - OS_LNX_Entity *entity = os_w32_entity_alloc(OS_LNX_EntityKind_Barrier); - pthread_barrier_init(&entity->barrier, count); + OS_LNX_Entity *entity = os_lnx_entity_alloc(OS_LNX_EntityKind_Barrier); + pthread_barrier_init(&entity->barrier, 0, count); OS_Handle result = {IntFromPtr(entity)}; return result; }