[Issue 1036] New: regression: invalid code generation for class literal expression unless -fPIC or -release is used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 7 15:08:23 PST 2007


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

           Summary: regression: invalid code generation for class literal
                    expression unless -fPIC or -release is used
           Product: DGCC aka GDC
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: glue layer
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: thomas-dloop at kuehne.cn


# int main(){
#    int status;
#    
#    int delegate() foo(){
#       return &(new class
#          {
#             int dg(){
#                return ++status;
#             }
#          }
#       ).dg;
#    }
# 
#    int delegate() bar = foo();
#    
#    if(status != 0){
#       assert(0);
#    }
# 
#    if(bar() != 1){
#       assert(0);
#    }
# 
#    if(status != 1){
#       assert(0);
#    }
# 
#    return 0;
# }

gdmd-0.23 run/c/class_26_B.d -ofx && ./x -> Error: AssertError Failure 
run/c/class_26_B.d(32)
gdmd-0.23 run/c/class_26_B.d -fPIC -ofx && ./x -> success

test case:
http://dstress.kuehne.cn/run/c/class_26_B.d


-- 



More information about the D.gnu mailing list