What    |Removed                     |Added
           Keywords|                            |patch
           Severity|normal                      |major

--- Comment #2 from 2011-04-19 12:57:50 PDT ---
I changed importance to mayor, because this also affects some compiler
rewrites, and the fix is trivial.

int weakly_pure_function(out param)pure{...}
1^^weakly_pure_function(param), will be optimized away to
(weakly_pure_function(param),1) and then only 1, without setting the param.

This bug exists because the compiler incorrectly assumes that a weakly pure
function has no side effects.

Suggested fix:
in expression.c, function CallExp::checkSideEffect, replace

(~line 7278)

-     if (t->ty == Tfunction && ((TypeFunction *)t)->purity)
-         return 0;


+     if (t->ty == Tfunction && ((TypeFunction *)t)->purity > PUREweak)
+         return 0;

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to