History

Fix vla type bug for stabs/dwarf

The wrong vla stabs code was accepted by gdb. The dwarf vla code was fatal.

herman ten brugge committed 4 years ago

Commit 9a81e631 parent 2caaff21 file · +4 −4Browse files

Unified · Split

tccdbg.c+4−4
@@ -1266,7 +1266,7 @@ static void tcc_get_debug_info(TCCState *s1, Sym *s, CString *result) · 1265 unmodified lines
1266 CString str;1266 CString str;
1267 1267
1268 for (;;) {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 if ((type & VT_BTYPE) != VT_BYTE)1270 if ((type & VT_BTYPE) != VT_BYTE)
1271 type &= ~VT_DEFSIGN;1271 type &= ~VT_DEFSIGN;
1272 if (type == VT_PTR || type == (VT_PTR | VT_ARRAY))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 cstr_printf (result, "%d=", ++debug_next_type);1351 cstr_printf (result, "%d=", ++debug_next_type);
1352 t = s;1352 t = s;
1353 for (;;) {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 if ((type & VT_BTYPE) != VT_BYTE)1355 if ((type & VT_BTYPE) != VT_BYTE)
1356 type &= ~VT_DEFSIGN;1356 type &= ~VT_DEFSIGN;
1357 if (type == VT_PTR)1357 if (type == VT_PTR)
@@ -1381,7 +1381,7 @@ static int tcc_get_dwarf_info(TCCState *s1, Sym *s) · 23 unmodified lines
1381 int retval;1381 int retval;
1382 1382
1383 for (;;) {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 if ((type & VT_BTYPE) != VT_BYTE)1385 if ((type & VT_BTYPE) != VT_BYTE)
1386 type &= ~VT_DEFSIGN;1386 type &= ~VT_DEFSIGN;
1387 if (type == VT_PTR || type == (VT_PTR | VT_ARRAY))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 retval = debug_type;1523 retval = debug_type;
1524 t = s;1524 t = s;
1525 for (;;) {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 if ((type & VT_BTYPE) != VT_BYTE)1527 if ((type & VT_BTYPE) != VT_BYTE)
1528 type &= ~VT_DEFSIGN;1528 type &= ~VT_DEFSIGN;
1529 if (type == VT_PTR) {1529 if (type == VT_PTR) {

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