Thread overview
[Issue 1161] New: Access to private static members is allowed from other module.
Apr 18, 2007
d-bugmail
May 05, 2008
d-bugmail
May 07, 2008
d-bugmail
Sep 27, 2008
d-bugmail
Sep 27, 2008
d-bugmail
Sep 30, 2008
d-bugmail
Dec 10, 2008
d-bugmail
[Issue 1161] [module] Access to private static members is allowed from other module.
Dec 19, 2012
Kenji Hara
Dec 19, 2012
Andrej Mitrovic
April 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1161

           Summary: Access to private static members is allowed from other
                    module.
           Product: D
           Version: 1.012
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: aarti@interia.pl


-----------
module static_a;
import static_b;
void main() {
    Test.counter=5;
}
-----------
module static_b;
class Test {
private:
    static int counter=0;
}


-- 

May 05, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161





------- Comment #1 from tomas@famolsen.dk  2008-05-04 21:10 -------
Adding the following line to expressions.c(VarExp::semantic) catches it:

// check access to VarDeclaration
accessCheck(loc, sc, NULL, var);


-- 

May 07, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161





------- Comment #2 from tomas@famolsen.dk  2008-05-06 22:48 -------
I've compiled several tango modules with this fix in place and it has already exposed two bugs in tango and no false positives so far.

;)


-- 

September 27, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161


tomas@famolsen.dk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |trivial




------- Comment #3 from tomas@famolsen.dk  2008-09-27 09:14 -------
This fix has been in place in LLVMDC for a long time, the change is trivial, it's not yet produced any false positives, just found bugs ... could we please get this into DMD ?


-- 

September 27, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161


matti.niemenmaa+dbugzilla@iki.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matti.niemenmaa+dbugzilla@ik
                   |                            |i.fi
           Severity|trivial                     |normal
           Keywords|                            |patch




------- Comment #4 from matti.niemenmaa+dbugzilla@iki.fi  2008-09-27 11:15 -------
Severity doesn't mean how easy an issue is to fix. I set it back to "normal" and added the "patch" keyword instead.

As an aside, does that patch also fix Issue 313? What about Issue 314?


-- 

September 30, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161





------- Comment #5 from kamm-removethis@incasoftware.de  2008-09-30 00:37 -------
(In reply to comment #4)
> As an aside, does that patch also fix Issue 313? What about Issue 314?

No it doesn't, but 314 has a patch that could be adapted to fix both. I didn't apply it to LLVMDC since it'd break compatibility to DMD in a fairly major way. On the other hand, it *is* a bug; I'll look at it again.


-- 

December 10, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1161


tomas@famolsen.dk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |




------- Comment #6 from tomas@famolsen.dk  2008-12-10 06:58 -------
The fix I proposed is indeed broken (or accessCheck is), it causes protection problems when instantiating imported templates passing private variables as alias template parameters. I've removed it from LDC again. Removing patch keyword


-- 

December 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=1161



--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-18 21:38:56 PST ---
Partially fixed in issue 5385.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=1161


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #8 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-19 02:25:48 PST ---
(In reply to comment #7)
> Partially fixed in issue 5385.

Which testcases did I miss?

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