#ifndef ScopeChain_h
#define ScopeChain_h
-#include <wtf/Assertions.h>
+#include "FastAllocBase.h"
namespace JSC {
class JSObject;
class ScopeChainIterator;
- class ScopeChainNode {
+ class ScopeChainNode : public FastAllocBase {
public:
ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSObject* globalThis)
: next(next)
{
ASSERT(globalData);
}
+#ifndef NDEBUG
+ // Due to the number of subtle and timing dependent bugs that have occurred due
+ // to deleted but still "valid" ScopeChainNodes we now deliberately clobber the
+ // contents in debug builds.
+ ~ScopeChainNode()
+ {
+ next = 0;
+ object = 0;
+ globalData = 0;
+ globalThis = 0;
+ }
+#endif
ScopeChainNode* next;
JSObject* object;
{
if (m_node)
m_node->deref();
+#ifndef NDEBUG
+ m_node = 0;
+#endif
}
void swap(ScopeChain&);