Skip to content

Commit

Permalink
Use kind to determine the type
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyphack committed Nov 9, 2024
1 parent a9d66fd commit 076120c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codegen/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ general_type *new_struct_type(char *struct_name)
int types_equal(general_type *a, general_type *b, context *ctx)
{
// Special case for handling assigning NULL to pointers
if (a->size == pointer_type_size)
if (a->kind == TYPE_POINTER)
{
if (b->size == primitive_type_size)
if (b->kind == TYPE_PRIMITIVE)
{
char *type_name = ((primitive_type *)b->data)->type_name;
if (strcmp(type_name, "TKN_INT") == 0)
Expand Down

0 comments on commit 076120c

Please sign in to comment.