windelbouwman / ppci

A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
https://ppci.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
337 stars 36 forks source link

ppci-cc: a function declared in another function definition makes the IR generator crash #88

Open tstreiff opened 4 years ago

tstreiff commented 4 years ago

void exit(int);
int main() { exit(1); }

is compiled and executed correctly.

int main() { void exit(int);
exit(1); }

raises an exception in the front-end

File "/home/tsf/sandbox/ppci/ppci/lang/c/codegenerator.py", line 1373, in gen_variable_access value = self.ir_var_map[declaration] KeyError: Function storage=None typ=Function-type name=exit