[LLVMbugs] [Bug 13676] New: [Windows] Segmentation fault when filling an int-int struct to be returned

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 23 05:55:09 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13676

             Bug #: 13676
           Summary: [Windows] Segmentation fault when filling an int-int
                    struct to be returned
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


As of r160851,

$ cat with_cl.cpp
struct S {
  int a, b;
};

class C {
 public:
  S foo();
};

S C::foo() {
  S ret;
  ret.a = 1;
  ret.b = 2;
  return ret;
}
///////////////////// EOF
$ cat with_clang.cpp
struct S {
  int a, b;
};

class C {
 public:
  S foo();
};

int main() {
  C c;
  S s = c.foo();
  if (s.a != 1)
    return 1;
  if (s.b != 2)
    return 2;
}
///////////////////// EOF
$ clang -Xclang -cxx-abi -Xclang microsoft -c with_clang.cpp && cl -nologo -c
with_cl.cpp && link -nologo with_cl.obj with_clang.o

$ with_cl.exe
Segmentation fault

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list