[dmd-internals] [D-Programming-Language/dmd] 7daa39: fix Issue 8939 - ICE(glue.c) on passing by ref sta...

kenji hara k.hara.pg at gmail.com
Thu Nov 15 05:40:20 PST 2012


Thanks very much. I posted a pull request #1293 to fix the regression.
We must fix it before 2.061 release.

Kenji Hara

2012/11/15 Rainer Schuetze <r.sagitario at gmx.de>:
> On 11/15/2012 3:46 AM, GitHub wrote:
>>
>>    Branch: refs/heads/master
>>    Home:   https://github.com/D-Programming-Language/dmd
>>    Commit: 7daa39cc3ff563b50004cda86f4cdc1ae76c2888
>>
>> https://github.com/D-Programming-Language/dmd/commit/7daa39cc3ff563b50004cda86f4cdc1ae76c2888
>>    Author: k-hara <k.hara.pg at gmail.com>
>>    Date:   2012-11-14 (Wed, 14 Nov 2012)
>>
>>    Changed paths:
>>      M src/expression.c
>>      M src/interpret.c
>>      M src/optimize.c
>>      M test/runnable/constfold.d
>>
>>    Log Message:
>>    -----------
>>    fix Issue 8939 - ICE(glue.c) on passing by ref statically initialized
>> const/immutable variable
>>
>> Don't optimize an argument on ref parameter, even which can interpret at
>> compile time.
>
>
> This seems to have broken this code:
>
>
> class C
> {
>         const int kIndex = 0;
>
>         //////////////////////////////////////////////////////////////
>         int refValue(V)(ref V var)
>         {
>                 return var.length;
>         }
>
>         bool foo()
>         {
>                 string str[2];
>                 return refValue(str[kIndex]) != 0;
>         }
>
> }
>
>
> compiled with -O:
>
> test.d(15): Error: variable kIndex used before set
>
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals


More information about the dmd-internals mailing list