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
12661266 CString str;
12671267
12681268 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);
12701270 if ((type & VT_BTYPE) != VT_BYTE)
12711271 type &= ~VT_DEFSIGN;
12721272 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
13511351 cstr_printf (result, "%d=", ++debug_next_type);
13521352 t = s;
13531353 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);
13551355 if ((type & VT_BTYPE) != VT_BYTE)
13561356 type &= ~VT_DEFSIGN;
13571357 if (type == VT_PTR)
@@ -1381,7 +1381,7 @@ static int tcc_get_dwarf_info(TCCState *s1, Sym *s) · 23 unmodified lines
13811381 int retval;
13821382
13831383 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);
13851385 if ((type & VT_BTYPE) != VT_BYTE)
13861386 type &= ~VT_DEFSIGN;
13871387 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
15231523 retval = debug_type;
15241524 t = s;
15251525 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;
15271527 if ((type & VT_BTYPE) != VT_BYTE)
15281528 type &= ~VT_DEFSIGN;
15291529 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