History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-544
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Arron Washington
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Boo compiler generating unorthodox code!

Created: 24/Oct/05 08:40 PM   Updated: 01/Sep/07 09:21 AM
Component/s: Compiler
Affects Version/s: 0.7
Fix Version/s: 0.7.8

Time Tracking:
Not Specified


 Description  « Hide
SpookyET noted this strange occurance of generated code, where everything is nested inside of the first if, a bug.

#His boo code
if Verbosity:
if string.Compare(
Verbosity,
'Normal',
StringComparison.InvariantCultureIgnoreCase) == 0:

pass

elif string.Compare(
Verbosity,
'Warning',
StringComparison.InvariantCultureIgnoreCase) == 0:

commandLine.AppendSwitch('-v')

elif string.Compare(
Verbosity,
'Info',
StringComparison.InvariantCultureIgnoreCase) == 0:

commandLine.AppendSwitch('-vv')

elif string.Compare(
Verbosity,
'Verbose',
StringComparison.InvariantCultureIgnoreCase) == 0:

commandLine.AppendSwitch('-vvv')

else:
Log.LogErrorWithCodeFromResources(
'Vbc.EnumParameterHasInvalidValue',
'Verbosity',
Verbosity,
'Normal, Warning, Info, Verbose')

commandLine.AppendFileNamesIfNotNull(Sources, ' ')

#what the compiler generated
if (this.Verbosity != null)
{
if (string.Compare(this.Verbosity, "Normal", StringComparison.InvariantCultureIgnoreCase) != 0)
{
if (string.Compare(this.Verbosity, "Warning", StringComparison.InvariantCultureIgnoreCase) == 0)

{ commandLine.AppendSwitch("-v"); }

else if (string.Compare(this.Verbosity, "Info", StringComparison.InvariantCultureIgnoreCase) == 0)

{ commandLine.AppendSwitch("-vv"); }

else if (string.Compare(this.Verbosity, "Verbose", StringComparison.InvariantCultureIgnoreCase) == 0)

{ commandLine.AppendSwitch("-vvv"); }

else
{
object[] objArray1 = new object[3] { "Verbosity", this.Verbosity, "Normal, Warning, Info, Verbose" } ;
this.Log.LogErrorWithCodeFromResources("Vbc.EnumParameterHasInvalidValue", objArray1);
}
}
commandLine.AppendFileNamesIfNotNull(this.Sources, " ");
}



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 24/Oct/05 08:46 PM
It's not the compiler that is generating unorthodox code. It's the decompiler which is not being able to reconstruct the exact structure of the original code because of the empty bodied if.