[cfe-commits] r59405 - /cfe/trunk/lib/CodeGen/CGExprConstant.cpp

Eli Friedman eli.friedman at gmail.com
Sun Nov 16 16:24:58 PST 2008


On Sat, Nov 15, 2008 at 10:23 PM, Anders Carlsson <andersca at mac.com> wrote:
> +      if (const Expr *LVBase = V.getLValueBase()) {
> +        llvm::Constant *Base =
> +          ConstExprEmitter(*this, CGF).EmitLValue(const_cast<Expr*>(LVBase));
> +
> +        return llvm::ConstantExpr::getGetElementPtr(Base, &Offset, 1);
> +      }

This is wrong: Offset is in bytes, and the type of the expression
isn't guaranteed to be the same as the type of the base.

-Eli



More information about the cfe-commits mailing list