The wrong vla stabs code was accepted by gdb. The dwarf vla code was fatal.
Unified · Split
| @@ -1266,7 +1266,7 @@ static void tcc_get_debug_info(TCCState *s1, Sym *s, CString *result) · 1265 unmodified lines | ||
| 1266 | 1266 | CString str; |
| 1267 | 1267 | |
| 1268 | 1268 | for (;;) { |
| 1269 | − type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE); | |
| 1269 | + type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE | VT_VLA); | |
| 1270 | 1270 | if ((type & VT_BTYPE) != VT_BYTE) |
| 1271 | 1271 | type &= ~VT_DEFSIGN; |
| 1272 | 1272 | if (type == VT_PTR || type == (VT_PTR | VT_ARRAY)) |
| @@ -1351,7 +1351,7 @@ static void tcc_get_debug_info(TCCState *s1, Sym *s, CString *result) · 78 unmodified lines | ||
| 1351 | 1351 | cstr_printf (result, "%d=", ++debug_next_type); |
| 1352 | 1352 | t = s; |
| 1353 | 1353 | for (;;) { |
| 1354 | − type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE); | |
| 1354 | + type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE | VT_VLA); | |
| 1355 | 1355 | if ((type & VT_BTYPE) != VT_BYTE) |
| 1356 | 1356 | type &= ~VT_DEFSIGN; |
| 1357 | 1357 | if (type == VT_PTR) |
| @@ -1381,7 +1381,7 @@ static int tcc_get_dwarf_info(TCCState *s1, Sym *s) · 23 unmodified lines | ||
| 1381 | 1381 | int retval; |
| 1382 | 1382 | |
| 1383 | 1383 | for (;;) { |
| 1384 | − type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE); | |
| 1384 | + type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE | VT_VLA); | |
| 1385 | 1385 | if ((type & VT_BTYPE) != VT_BYTE) |
| 1386 | 1386 | type &= ~VT_DEFSIGN; |
| 1387 | 1387 | if (type == VT_PTR || type == (VT_PTR | VT_ARRAY)) |
| @@ -1523,7 +1523,7 @@ static int tcc_get_dwarf_info(TCCState *s1, Sym *s) · 135 unmodified lines | ||
| 1523 | 1523 | retval = debug_type; |
| 1524 | 1524 | t = s; |
| 1525 | 1525 | for (;;) { |
| 1526 | − type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE); | |
| 1526 | + type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE) | VT_VLA; | |
| 1527 | 1527 | if ((type & VT_BTYPE) != VT_BYTE) |
| 1528 | 1528 | type &= ~VT_DEFSIGN; |
| 1529 | 1529 | if (type == VT_PTR) { |