harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8376c3d205dffff25aa6294fde4c8e57f39af613
parent 658dded6ba43f7ada9facda345742e4039fa12ec
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 31 Jan 2021 10:33:21 -0500

types: fix oversight in assignability

strip_flags does not return a singleton.

Diffstat:
Msrc/types.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/types.c b/src/types.c @@ -446,8 +446,8 @@ type_is_assignable(const struct type *to, const struct type *from) case TYPE_STORAGE_NULL: return to->pointer.flags & PTR_NULLABLE; case TYPE_STORAGE_POINTER: - from_secondary = strip_flags( - from->pointer.referent, &_from_secondary); + from_secondary = strip_flags(from->pointer.referent, + &_from_secondary); switch (to_secondary->storage) { case TYPE_STORAGE_VOID: return true; @@ -457,7 +457,7 @@ type_is_assignable(const struct type *to, const struct type *from) } break; default: - if (to_secondary != from_secondary) { + if (to_secondary->id != from_secondary->id) { return false; } break;