From 1310fbbe4f7288eabb69723701ce4b6c5095376d Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 25 Feb 2013 16:37:46 -0700 Subject: [PATCH] reset alignment at inheritence boundary when iterating over fields In type-generator, we were incorrectly calculating field offsets where a class inherits from another class whose last field has a natural alignment which is different from the native word size. Surprisingly, this only popped up when I built using the Android class library on a 64-bit system. --- src/tools/type-generator/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/type-generator/main.cpp b/src/tools/type-generator/main.cpp index 9186bc68ae..fbd4fd6909 100644 --- a/src/tools/type-generator/main.cpp +++ b/src/tools/type-generator/main.cpp @@ -662,6 +662,7 @@ class MemberIterator { assert(member->type == Object::Scalar); offset_ = ((offset_ + size_) + (BytesPerWord - 1)) & ~(BytesPerWord - 1); + alignment_ = BytesPerWord; member = 0; }