[LLVMbugs] [Bug 6739] New: If/else scoping problem

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 29 17:05:36 PDT 2010


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

           Summary: If/else scoping problem
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


On this code:

void SSEDomainFixPass::Force(int rx, unsigned domain) {
  hasLiveRegs = true;
  if (DomainValue *dv = LiveRegs[rx]) {
    if (dv->collapsed())
      dv->add(domain);
    else
      Collapse(dv, domain);
  } else {
    // Set up basic collapsed DomainValue
    DomainValue *dv = Pool.Alloc();
    dv->add(domain);
    SetLiveReg(rx, dv);
  }
}

We complain about "dv" being redeclared (which it isn't), then go on to
complain that "dv" is NULL in this context.

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