changeset 298:be8aa0774db1

[project @ 2003-10-17 20:59:15 by bellard] fixed assignment of const struct in struct
author bellard
date Fri, 17 Oct 2003 20:59:15 +0000
parents 4774a42a5100
children f9b0dd21990c
files tcc.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Fri Oct 17 20:43:47 2003 +0000
+++ b/tcc.c	Fri Oct 17 20:59:15 2003 +0000
@@ -5856,7 +5856,11 @@
         /* XXX: more tests */
         break;
     case VT_STRUCT:
-        if (!is_compatible_types(dt, st)) {
+        tmp_type1 = *dt;
+        tmp_type2 = *st;
+        tmp_type1.t &= ~(VT_CONSTANT | VT_VOLATILE);
+        tmp_type2.t &= ~(VT_CONSTANT | VT_VOLATILE);
+        if (!is_compatible_types(&tmp_type1, &tmp_type2)) {
         error:
             type_to_str(buf1, sizeof(buf1), st, NULL);
             type_to_str(buf2, sizeof(buf2), dt, NULL);