Unified · Split
| @@ -742,7 +742,7 @@ ST_FUNC int gv(int rc) · 741 unmodified lines | |||
| 742 | bit_pos = (vtop->type.t >> VT_STRUCT_SHIFT) & 0x3f; | 742 | bit_pos = (vtop->type.t >> VT_STRUCT_SHIFT) & 0x3f; |
| 743 | bit_size = (vtop->type.t >> (VT_STRUCT_SHIFT + 6)) & 0x3f; | 743 | bit_size = (vtop->type.t >> (VT_STRUCT_SHIFT + 6)) & 0x3f; |
| 744 | /* remove bit field info to avoid loops */ | 744 | /* remove bit field info to avoid loops */ |
| 745 | vtop->type.t &= ~(VT_BITFIELD | (-1 << VT_STRUCT_SHIFT)); | 745 | vtop->type.t &= ~VT_BITFIELD & ((1 << VT_STRUCT_SHIFT) - 1); |
| 746 | /* cast to int to propagate signedness in following ops */ | 746 | /* cast to int to propagate signedness in following ops */ |
| 747 | if ((vtop->type.t & VT_BTYPE) == VT_LLONG) { | 747 | if ((vtop->type.t & VT_BTYPE) == VT_LLONG) { |
| 748 | type.t = VT_LLONG; | 748 | type.t = VT_LLONG; |
| @@ -2545,7 +2545,8 @@ ST_FUNC void vstore(void) · 1796 unmodified lines | |||
| 2545 | && !(vtop->type.t & VT_BITFIELD)) { | 2545 | && !(vtop->type.t & VT_BITFIELD)) { |
| 2546 | /* optimize char/short casts */ | 2546 | /* optimize char/short casts */ |
| 2547 | delayed_cast = VT_MUSTCAST; | 2547 | delayed_cast = VT_MUSTCAST; |
| 2548 | vtop->type.t = ft & (VT_TYPE & ~(VT_BITFIELD | (-1 << VT_STRUCT_SHIFT))); | 2548 | vtop->type.t = (ft & VT_TYPE & ~VT_BITFIELD & |
| 2549 | ((1 << VT_STRUCT_SHIFT) - 1)); | ||
| 2549 | /* XXX: factorize */ | 2550 | /* XXX: factorize */ |
| 2550 | if (ft & VT_CONSTANT) | 2551 | if (ft & VT_CONSTANT) |
| 2551 | tcc_warning("assignment of read-only location"); | 2552 | tcc_warning("assignment of read-only location"); |
| @@ -2599,7 +2600,7 @@ ST_FUNC void vstore(void) · 47 unmodified lines | |||
| 2599 | bit_pos = (ft >> VT_STRUCT_SHIFT) & 0x3f; | 2600 | bit_pos = (ft >> VT_STRUCT_SHIFT) & 0x3f; |
| 2600 | bit_size = (ft >> (VT_STRUCT_SHIFT + 6)) & 0x3f; | 2601 | bit_size = (ft >> (VT_STRUCT_SHIFT + 6)) & 0x3f; |
| 2601 | /* remove bit field info to avoid loops */ | 2602 | /* remove bit field info to avoid loops */ |
| 2602 | vtop[-1].type.t = ft & ~(VT_BITFIELD | (-1 << VT_STRUCT_SHIFT)); | 2603 | vtop[-1].type.t = ft & ~VT_BITFIELD & ((1 << VT_STRUCT_SHIFT) - 1); |
| 2603 | 2604 | ||
| 2604 | if((ft & VT_BTYPE) == VT_BOOL) { | 2605 | if((ft & VT_BTYPE) == VT_BOOL) { |
| 2605 | gen_cast(&vtop[-1].type); | 2606 | gen_cast(&vtop[-1].type); |