|
From: | James Cook |
Subject: | Alignment error in class_addIvar |
Date: | Tue, 17 Apr 2012 12:08:49 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120326 Thunderbird/10.0.3 |
There appears to be an error in ./modules/core/base/Source/ObjectiveC2/runtime.c - specifically, the class_addIvar function. When calculating an aligned offset for the new ivar, the offset is first right-shifted by the alignment but is only left-shifted again if the field is not already aligned. The end result is that when adding an ivar that doesn't require any padding, the ivar will end up at an offset that overlaps something else.
The easiest fix would probably be to add a line "else off = off << alignment;" before "ivar->ivar_offset = off;" (which is line 186 in the svn version I'm looking at here).
-- James
[Prev in Thread] | Current Thread | [Next in Thread] |