aboutsummaryrefslogtreecommitdiff
path: root/tcclib.h
diff options
context:
space:
mode:
authorgrischka <grischka>2014-04-04 20:18:39 +0200
committergrischka <grischka>2014-04-04 20:20:44 +0200
commit5879c854fb94f722a7ffdd4e895c9ce418548959 (patch)
tree63f264a9801208674d477322f2bf487edd0234b5 /tcclib.h
parent2024c445411f80b7c4b761322521d823e606418d (diff)
downloadtinycc-5879c854fb94f722a7ffdd4e895c9ce418548959.tar.gz
tinycc-5879c854fb94f722a7ffdd4e895c9ce418548959.tar.bz2
tccgen: x86_64: fix garbage in the SValue upper bits
This was going wrong (case TOK_LAND in unary: computed labels) - vset(&s->type, VT_CONST | VT_SYM, 0); - vtop->sym = s; This does the right thing and is shorter: + vpushsym(&s->type, s); Test case was: int main(int argc, char **argv) { int x; static void *label_return = &&lbl_return; printf("label_return = %p\n", label_return); goto *label_return; //<<<<< here segfault on linux X86_64 without the memset on vset printf("unreachable\n"); lbl_return: return 0; } Also:: - Rename "void* CValue.ptr" to more usable "addr_t ptr_offset" and start to use it in obvious cases. - use __attribute__ ((noreturn)) only with gnu compiler - Revert CValue memsets ("After several days searching ...") commit 4bc83ac3933efa565ae3326b55fcd711b63c073d Doesn't mean that the vsetX/vpush thingy isn't brittle and there still might be bugs as to differences in how the CValue union was set and is then interpreted later on. However the big memset hammer was just too slow (-3% overall).
Diffstat (limited to 'tcclib.h')
0 files changed, 0 insertions, 0 deletions