www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9458] New: ModExp generates invalid code against array operands

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9458

           Summary: ModExp generates invalid code against array operands
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2013-02-05 22:48:41 PST ---
In this code, line 4 is not valid array-operation. But, compiler accepts such
invalid code.
Note that: slice expression MUST appear in LHS operand for valid array
operation.

void main()
{
    int[] a = [1, 2, 3];
    a = a[] % a[];  // line 4

    import std.stdio;
    writeln(a);  // prints "[]"
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9458


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-02-05 23:22:38 PST ---
https://github.com/D-Programming-Language/dmd/pull/1628

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9458



--- Comment #2 from github-bugzilla puremagic.com 2013-02-06 00:47:27 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3617db071c687524b763ba333399e95369a0d453
fix Issue 9458 - ModExp generates invalid code against array operands

https://github.com/D-Programming-Language/dmd/commit/cf85813054054dfe6605ef1f184bf12eab668c1e
Merge pull request #1628 from 9rnsr/fix9418

Issue 9418 + 9458 - Invalid array operation should be rejected in glue layer

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9458


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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