History

Catch array[index] with unknown sizeof(*array)

We could support this for index == 0, but GCC doesn't bother, so why should we?

Daniel Glöckner committed 16 years ago

Commit 4d05a631 parent 95b9a471 file · +5 −2Browse files

Unified · Split

tccgen.c+5−2
@@ -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_641554#ifdef TCC_TARGET_X86_64
1552 vpushll(pointed_size(&vtop[-1].type));1555 vpushll(u);
1553#else1556#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#endif1559#endif
1557 gen_op('*');1560 gen_op('*');
1558#ifdef CONFIG_TCC_BCHECK1561#ifdef CONFIG_TCC_BCHECK

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t