Bug 9458 – ModExp generates invalid code against array operands

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-05T22:48:00Z
Last change time
2013-02-06T00:48:12Z
Keywords
accepts-invalid, pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-02-05T22:48:41Z
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 "[]" }
Comment #1 by k.hara.pg — 2013-02-05T23:22:38Z
Comment #2 by github-bugzilla — 2013-02-06T00:47:27Z
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