mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
fix pointer/array comparison paths not being enabled for not-equal; fix value arithmetic paths applying in type comparisons
This commit is contained in:
+14
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user