mcs optimises falsly code out in "if ( ... &&false)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mono |
Fix Released
|
Medium
|
|||
mono (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mono-mcs
My collegue Martin Zaworski found a misbehaviour, we have then tracked it down to following:
if (foo++ && false) {
} else {
//foo isn't incremented
}
So, in an conditional statement, with &&false, the left hand side doesn't run(or gets compiled), no side effects are
executed. Also no function() can be called inside there).
Works also with assignments, optimisation switches don't matter.
Microsoft csc.exe is void of that problem
Package: mono-mcs 1.2.4-6ubuntu4
Also affected is the current svn version (21/9/2007).
We have here now untrusted compiled binaries, unless it's verificable, that this kind of source coding isn't used,
they have to be recompiled with a fixed version of the compiler.
Changed in mono: | |
status: | Unknown → Confirmed |
Changed in mono: | |
status: | Confirmed → Fix Released |
Changed in mono: | |
importance: | Unknown → Medium |
To clarify, this bug is not fixed and exists in current svn, output of svn info:
Path: . mono-project. com/source/ trunk/mcs mono-project. com/source bce8-0310- ba0a-eca2169e75 18
URL: svn://anonsvn.
Repository Root: svn://anonsvn.
Repository UUID: e3ebcda4-
Revision: 86462
Node Kind: directory
Schedule: normal
Last Changed Author: mhabersack
Last Changed Rev: 86461
Last Changed Date: 2007-09-27 10:17:33 +0300 (Do, 27 Sep 2007)