mewmew/uc

sem: Global variable declarations inserted into scope twice

mewmew opened this issue · 1 comments

Global variable declarations are added twice, thus resulting in incorrect mapping of tentative definitions.

Proof of concept based on revision 25bc47e.

Got:

u@x1 ~/D/g/s/g/m/u/foo> uclang a.c
Compiling "a.c"
ident.Start() 4
def.Start() 4
Log:irgen.go:435: create global variable int x;
ident.Start() 11
def.Start() 11
Log:irgen.go:435: create global variable int x;

Expected:

u@x1 ~/D/g/s/g/m/u/foo> uclang a.c
Compiling "a.c"
ident.Start() 4
def.Start() 11
Log:irgen.go:431: ignoring tentative global variable definition of x
ident.Start() 11
def.Start() 11
Log:irgen.go:435: create global variable int x;

Fixed in rev 8208eb1.