1

Closed

local variable initialization in the wrong place

description

There's an ILocalVariableDeclaration statement in a nested statement block, but it's being referenced outside that block (when the variable is out of scope). Pseudocode:  while ( something ) { int x = 3; } x = 4; // Error: x already went out of scope. Repro: - Open attached zip and look at bin\debug\cci-dup-case.txt- Note that __temp_5 is declared in a deeper scope than it should be.

file attachments

Closed Jan 5, 2013 at 1:05 AM by hermanv

comments

YodaSkywalker wrote Mar 19, 2012 at 5:17 PM

Also note that there is a second bug here where CS$4$0000 is not initialized before being used.

hermanv wrote Mar 19, 2012 at 10:24 PM

This ouput was produced with the old decompiler and it is a known problem that is too much work to fix in that code base. The new decompiler does better, but still has a push and pop instruction because there is no Code Model equivalent of the C# construct for constructing a list with initialized elements.

hermanv wrote Jan 5, 2013 at 1:03 AM

The old decompiler has gone away.