[Issue 4254] ICE(mtype.c): function with const inout parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 1 18:51:01 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4254


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
         OS/Version|Linux                       |All


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-11-01 18:50:04 PDT ---
In mtype.c, 
Type::addstorageclass() can result in any combination of const, shared, wild.
But not all possible combinations are considered in Type::addmod.
The missing cases are MODconst | MODwild and MODshared | MODconst | MODwild.
Apparently, if both const and wild are present, wild should be ignored.

So, Type::addStorageClass(), line 1180 should have 'else' added, to make
MODconst and MODwild mutually exclusive:


    if (stc & STCimmutable)
        mod = MODimmutable;
    else
    {   if (stc & (STCconst | STCin))
            mod = MODconst;
-        if (stc & STCwild)
+        else if (stc & STCwild)
            mod = MODwild;
        if (stc & STCshared)
            mod |= MODshared;
    }

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


More information about the Digitalmars-d-bugs mailing list