From e14c5e9a65b5cdc5306ad0e09b4416d5c9a7654f Mon Sep 17 00:00:00 2001 From: "pkw%us.ibm.com" Date: Thu, 22 Jan 2004 21:58:57 +0000 Subject: [PATCH] Bug 231104 - Checkin for Bug 195350 causes AIX build to segfault on startup. r=bugmail@sicking.cc, sr=tor@acm.org --- content/base/src/nsAttrAndChildArray.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/base/src/nsAttrAndChildArray.h b/content/base/src/nsAttrAndChildArray.h index ac0397876c81..aa8c7cde1dcb 100644 --- a/content/base/src/nsAttrAndChildArray.h +++ b/content/base/src/nsAttrAndChildArray.h @@ -92,7 +92,13 @@ public: const nsAttrValue* AttrAt(PRUint32 aPos) const { NS_ASSERTION(aPos < AttrCount(), "out-of-bounds access in nsAttrAndChildArray"); - return &NS_REINTERPRET_CAST(InternalAttr*, mImpl->mBuffer)[aPos].mValue; + /** + * Due to a compiler bug in VisualAge C++ for AIX, we need to return + * the address of the first index into mBuffer here. A similar fix + * was also made to the ATTRS macro in nsAttrAndChildArray.cpp. See + * Bug 231104. + */ + return &NS_REINTERPRET_CAST(InternalAttr*, &(mImpl->mBuffer[0]))[aPos].mValue; } nsresult SetAttr(nsIAtom* aLocalName, const nsAString& aValue); nsresult SetAttr(nsIAtom* aLocalName, nsHTMLValue* aValue);