http://d.puremagic.com/issues/show_bug.cgi?id=5798


timon.g...@gmx.ch changed:

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


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

Eg:
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;

by

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to