On Mon, Feb 23, 2009 at 08:28:14AM +0200, Igor Stasenko wrote:
Some more observations:
#include <stdio.h>
int main(int argc , char** argv) { int i;
i = 1; i = ({ int y=i; int i=6; printf("foo"); 10+y+i; }); printf("%d", i);
}
prints: foo17
so, to generate a proper inlined code, we should care only about name clashing for method arguments. In above code, suppose 'y' is an argument var, and 'i', declared in inner scope - a temporary var.
There is a bug in the inliner that produces name clashes like this. The fix is in http://bugs.squeak.org/view.php?id=7155
Related issues: Mantis 0007183: Various Slang problems masked by CPP macros. Mantis 0007189: CCodeGenerator>>doInlining: fix. Mantis 0007186: Interpreter>>loadFloatOrIntFrom: inlining broken. Mantis 0007155: Bug in TMethod>>renameVariablesUsing: Mantis 0007154: Interpreter main loop case generation fix.
Dave