We could support this for index == 0, but GCC doesn't bother, so why should we?
Unified · Split
| @@ -1548,11 +1548,14 @@ ST_FUNC void gen_op(int op) · 1547 unmodified lines | |||
| 1548 | } | 1548 | } |
| 1549 | type1 = vtop[-1].type; | 1549 | type1 = vtop[-1].type; |
| 1550 | type1.t &= ~VT_ARRAY; | 1550 | type1.t &= ~VT_ARRAY; |
| 1551 | u = pointed_size(&vtop[-1].type); | ||
| 1552 | if (u < 0) | ||
| 1553 | error("unknown array element size"); | ||
| 1551 | #ifdef TCC_TARGET_X86_64 | 1554 | #ifdef TCC_TARGET_X86_64 |
| 1552 | vpushll(pointed_size(&vtop[-1].type)); | 1555 | vpushll(u); |
| 1553 | #else | 1556 | #else |
| 1554 | /* XXX: cast to int ? (long long case) */ | 1557 | /* XXX: cast to int ? (long long case) */ |
| 1555 | vpushi(pointed_size(&vtop[-1].type)); | 1558 | vpushi(u); |
| 1556 | #endif | 1559 | #endif |
| 1557 | gen_op('*'); | 1560 | gen_op('*'); |
| 1558 | #ifdef CONFIG_TCC_BCHECK | 1561 | #ifdef CONFIG_TCC_BCHECK |