aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-25 17:48:21 +0000
committerChris Lattner <sabre@nondot.org>2007-11-25 17:48:21 +0000
commit5d3f5a155ec854bd56255e3bb92a8d190b2f9ff3 (patch)
treecee0bd3083f6e338950b4bf6ea2c2ae81cd71268
parent588e5ebee2db045c3611e0c8f601bc4495ebd0f3 (diff)
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
-rw-r--r--AST/Expr.cpp2
1 files changed, 1 insertions, 1 deletions
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());