History

type_size function returned incorrect size

of multi dimensional arrays if dimension is divisable by 2

Alexander Egorenkov committed 17 years ago

Commit 5a044b61 parent 64147b31 file · +8 −1Browse files

Unified · Split

tcc.c+8−1
@@ -6229,8 +6229,15 @@ static int type_size(CType *type, int *a) · 6228 unmodified lines
6229 return s->c;6229 return s->c;
6230 } else if (bt == VT_PTR) {6230 } else if (bt == VT_PTR) {
6231 if (type->t & VT_ARRAY) {6231 if (type->t & VT_ARRAY) {
6232 int ts;
6233
6232 s = type->ref;6234 s = type->ref;
6233 return type_size(&s->type, a) * s->c;6235 ts = type_size(&s->type, a);
6236
6237 if (ts < 0 && s->c < 0)
6238 ts = -ts;
6239
6240 return ts * s->c;
6234 } else {6241 } else {
6235 *a = PTR_SIZE;6242 *a = PTR_SIZE;
6236 return PTR_SIZE;6243 return PTR_SIZE;

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