From 5d3f5a155ec854bd56255e3bb92a8d190b2f9ff3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 25 Nov 2007 17:48:21 +0000 Subject: [PATCH] sizeof() return size in bytes, not bits, patch by Nuno Lopes! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44316 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/Expr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AST/Expr.cpp b/AST/Expr.cpp index fa1a3c95ff..77221392f2 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -589,7 +589,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, // Get information about the size or align. if (Exp->getOpcode() == UnaryOperator::SizeOf) Result = Ctx.getTypeSize(Exp->getSubExpr()->getType(), - Exp->getOperatorLoc()); + Exp->getOperatorLoc()) / 8; else Result = Ctx.getTypeAlign(Exp->getSubExpr()->getType(), Exp->getOperatorLoc()); -- 2.50.1