compiler/libec: Fixed crash in ComputeInstantiation()
authorJerome St-Louis <jerome@ecere.com>
Mon, 29 Jul 2013 09:02:29 +0000 (05:02 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 29 Jul 2013 09:02:29 +0000 (05:02 -0400)
- An Instance conversion property shed light on this
- Since normal classes return all their member offset relative to themselves, the base class struct size must be added to the Instance data

compiler/libec/src/pass15.ec

index 6da98a8..f439134 100644 (file)
@@ -4582,6 +4582,10 @@ void ComputeInstantiation(Expression exp)
                               
                               // CHANGED THIS HERE
                               eClass_FindDataMemberAndOffset(_class, dataMember.name, &dataMemberOffset, privateModule, null, null);
+
+                              // 2013/17/29 -- It seems that this was missing here!
+                              if(_class.type == normalClass)
+                                 dataMemberOffset += _class.base.structSize;
                               // dataMemberOffset = dataMember.offset;
                            }
                            found = true;