Bug 11925 – [2.065] [REGRESSION] ICE in CompoundStatement::semantic

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-14T15:02:00Z
Last change time
2014-01-15T00:50:39Z
Keywords
ice, pull
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2014-01-14T15:02:45Z
This pull: https://github.com/D-Programming-Language/dmd/commit/c8773c166b7a131aba9c4a2656dd20a3d4a170ac#src/statement.c-P57 Broken the following code on GDC after merging the 2.065 branch: void main() { try { try { L1: {} } finally { } } finally { } goto L1; }
Comment #1 by ibuclaw — 2014-01-14T15:04:06Z
Another example: void main() { switch (1) { case 1: goto L1; break; default: break; } try { L1: { } } finally { } }
Comment #2 by ibuclaw — 2014-01-14T15:07:53Z
What appears to happen at a cursory look: Array::remove => dim -= 1; Array::insert => realloc() corrupts array as no resize occurs [Next Loop] Array::remove => memmove causes ICE because 'dim' is no longer valid.
Comment #3 by ibuclaw — 2014-01-14T15:24:20Z
Looks like the culprit is Array::insert on a zero-length'd array.
Comment #4 by ibuclaw — 2014-01-14T15:38:36Z
Comment #5 by k.hara.pg — 2014-01-14T18:50:57Z
(In reply to comment #3) > Looks like the culprit is Array::insert on a zero-length'd array. I think Array::insert should also work for zero-length'd array. (In reply to comment #4) > https://github.com/D-Programming-Language/dmd/pull/3096 I opened another PR to fix logical failure in CompoundStatement::semantic. https://github.com/D-Programming-Language/dmd/pull/3099
Comment #6 by github-bugzilla — 2014-01-14T20:36:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6572dbf5e87a54d06347e538c0c846b666d4bb9d fix Issue 11925 - ICE in CompoundStatement::semantic https://github.com/D-Programming-Language/dmd/commit/da588730546af2e3c4732d3ade25b5002997a762 Merge pull request #3099 from 9rnsr/fix11925 [REG2.065a] Issue 11925 - ICE in CompoundStatement::semantic