[LLVMbugs] [Bug 13832] New: Problem with adjustment in thunk function when calling an overrriden function.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 13 04:31:28 PDT 2012


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

             Bug #: 13832
           Summary: Problem with adjustment in thunk function when calling
                    an overrriden function.
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rahul.s1 at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I tried the below Test Case and it seems that while generating the thunk for
the function B1:foo1 , there has been some error in the adjustment of base
class pointer so after the function call ( b1->foo1() ) has finished in test()
function , the this pointer is not adjusted to type of B1 , but it is still
pointing to type of D which is leading to this test case failure.

struct B1;
struct D;

struct B1
{
  virtual B1 *foo1 () {return this;}
};


struct Pad1 { virtual ~Pad1 (){}};
struct Proxy1 : Pad1, B1 {};

struct D : virtual Proxy1
{
  virtual D *foo1 () {return this;}
};

int test (B1 *b1)
{
  if (b1->foo1 () != b1)
    return 1;

  return 0;
}


int main ()
{
  D d;
  int r;

  if ((r = test (&d)))
    return r;

  return 0;
}

-- 
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