www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11925] New: [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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

           Summary: [2.065] [REGRESSION] ICE in
                    CompoundStatement::semantic
           Product: D
           Version: D1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ibuclaw ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:02:45 PST ---
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;
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code,
                   |                            |ice-on-valid-code
                 CC|                            |ibuclaw ubuntu.com
           Severity|normal                      |regression


--- Comment #1 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:04:06 PST ---
Another example:

void main()
{
  switch (1) {
    case 1:
      goto L1;
      break;

    default:
      break;
  }
  try {
    L1: { }
  }
  finally {
  }
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925



--- Comment #2 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:07:53 PST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925



--- Comment #3 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:24:20 PST ---
Looks like the culprit is Array::insert on a zero-length'd array.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925



--- Comment #4 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:38:36 PST ---
https://github.com/D-Programming-Language/dmd/pull/3096

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925



--- Comment #5 from Kenji Hara <k.hara.pg gmail.com> 2014-01-14 18:50:57 PST ---
(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 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 14 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925



--- Comment #6 from github-bugzilla puremagic.com 2014-01-14 20:36:10 PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11925


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code,        |ice, pull
                   |ice-on-valid-code           |
             Status|NEW                         |RESOLVED
            Version|D1                          |D2
         Resolution|                            |FIXED


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