Bug 15407 – Assert hit in toElem e2ir.c:1962

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-12-05T02:51:57Z
Last change time
2019-06-09T05:43:40Z
Keywords
ice-on-invalid-code, pull
Assigned to
No Owner
Creator
Lucas Burson

Attachments

IDFilenameSummaryContent-TypeSize
1568typescriptgdb bttext/plain4121

Comments

Comment #0 by ljdelight — 2015-12-05T02:51:57Z
Created attachment 1568 gdb bt I was playing around and caused the compiler to hit an assert. The code: import std.conv; void main(string[] args) { ubyte[6] array; if (array[0..5] == 6*[to!ubyte(0)]) { } } The assert: $ dmd ./test.d dmd: e2ir.c:1962: elem* toElem(Expression*, IRState*)::ToElemVisitor::toElemBin(BinExp*, int): Assertion `!((tb1->ty == Tarray || tb1->ty == Tsarray || tb2->ty == Tarray || tb2->ty == Tsarray) && tb2->ty != Tvoid && op != OPeq && op != OPandand && op != OPoror)' failed. [1] 497 abort (core dumped) dmd ./test.d
Comment #1 by ljdelight — 2015-12-05T02:52:56Z
I forgot the dmd version. v2.069.2.
Comment #2 by ketmar — 2015-12-05T08:43:34Z
(offtopic) i wonder why it's parsed normally in the first place.
Comment #3 by k.hara.pg — 2015-12-07T08:36:48Z
Comment #4 by github-bugzilla — 2016-01-31T12:44:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/49febeb29ef9aad6ef301fb5e14a896d2aba3a59 fix Issue 15407 - Assert hit in toElem e2ir.c:1962 https://github.com/D-Programming-Language/dmd/commit/cd200e3fda2252433f28967ed0ad2534b137e0bf Merge pull request #5303 from 9rnsr/fix15407 Issue 15407 - Assert hit in toElem e2ir.c:1962
Comment #5 by github-bugzilla — 2016-03-19T20:21:57Z
Comment #6 by dlang-bot — 2019-06-09T05:43:40Z
dlang/dmd pull request #9996 "[dmd-cxx] Issue 15407 - Assert hit in toElem e2ir.c:1962" was merged into dmd-cxx: - 676e9377e17f661c61e31af6d9ae7f0519d3ae86 by Iain Buclaw: [dmd-cxx] Issue 15407 - Assert hit in toElem e2ir.c:1962 https://github.com/dlang/dmd/pull/9996